New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port bash launcher to sh #7024
Port bash launcher to sh #7024
Conversation
$BASH_SOURCE give better guarantees (e.g. if the launcher is sourced instead of exec'd)
Values are stored as un-expanded variable expansions, i.e. '${1#-J}' and expanded when needed. The original positional parameters are kept as long as possible so they can be referenced by the "arrays". Currently there's no way to store an expansion with whitespace, but if necessary the whitespace could be stored in its own variable.
Nobody should be relying on |
Note we do have a |
Thank you! This has been merged to master. I will do some cleanup to move this to We look forward to further improvements! |
* bin/jruby.bash sh script moved to bin/jruby.sh * build copies bin/jruby.sh to bin/jruby if it is missing * bin/jruby.bash warns of deprecation and launches bin/jruby.sh * doco changes throughout See jruby#7024
The hardest thing to port is arrays, so I had the idea to store un-expanded variables in a string, then expand them with eval later. It's a little fragile to maintain but it works. Some documentation would probably be necessary to avoid unsafe evals.
I'm also not sure what to call the new script. I changed the shebang to
/bin/sh
for testing purposes but the filename still ends in .bash, and users may rely on that file being there.Depends on #7022.