Comments (3)
Ruby (tested but not reviewed):
#!/usr/bin/env ruby
require 'open3'
script_name = File.realpath(__FILE__)
jar_name = script_name.chomp(File.extname(script_name)) + '.jar'
jdk_dir = File.join(File.dirname(jar_name), '..', 'jdk', 'bin', 'java')
begin
stdout, stderr, status = Open3.capture3("#{jdk_dir} -jar #{jar_name}")
raise "Error launching tool:\n#{stderr}" unless status.success?
rescue
# Start failed. Try JAVA_HOME.
begin
jdk_dir = File.join(ENV['JAVA_HOME'], 'bin', 'java')
rescue
# No JAVA_HOME. Try just running java from PATH.
jdk_dir = 'java'
end
stdout, stderr, status = Open3.capture3("#{jdk_dir} -jar #{jar_name}")
raise "Error launching tool:\n#{stderr}" unless status.success?
end
# Wait 3 seconds and print stdout/stderr if the process exits
3.times do
sleep 1
stdout, stderr, status = Open3.capture3("#{jdk_dir} -jar #{jar_name}")
puts stdout
STDERR.puts stderr
break unless status.success?
end
from wpilibinstaller-avalonia.
For posterity, the script to be replaced is https://github.com/wpilibsuite/WPILibInstaller-Avalonia/blob/7e36ad377828664d4758affe143d405cb24f5e35/files/ToolsUpdater.py
from wpilibinstaller-avalonia.
All 3 scripts would actually need to be replaced there. And currently, these scripts are shared between linux and macos too. So there would be more work that would be necessary.
Also, if we change the extension, we'd need to update gradlerio and vscode. We'd also need to check if I launch the script as an executable, or as an argument to python in those cases (I don't remember).
from wpilibinstaller-avalonia.
Related Issues (20)
- Unable to build robot code after moving to WPILib 2023.1.1 Beta 2 HOT 3
- C++ Tools Not Installed on Apple Chip Macs
- Extraction progress bar does not seem to work
- macOS C++ tools don't extract.
- Option to use pre-installed vscode in installer. HOT 4
- Fix using the wrong platform installer not correctly erroring
- Check for disk free space HOT 2
- WPILib Installer error when VS Code is already installed HOT 2
- Move cancel button lower HOT 3
- segmentation fault when downloading VSCode Linux HOT 2
- Installing vscode completely offline HOT 4
- src.zip is not included in the JDK
- FRC VS Code 2023 icon doesn't show on desktop oin Ubuntu 22.04 HOT 1
- Mac notarization altool EOL HOT 1
- Add Python extension to VS Code installation HOT 1
- Add file association(s) for AdvantageScope
- WPILib Silent Install HOT 2
- XRP dependencies are not included in installer
- Consider enabling VS Code system certificates again
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wpilibinstaller-avalonia.