-
-
Notifications
You must be signed in to change notification settings - Fork 250
Make invocation of bash more Posix conformant. #459
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
base: master
Are you sure you want to change the base?
Conversation
Hard-coding the location of the shell to be in /bin/bash is not always working as not all Posix-conformant operating systems (such as NixOS) provide the path /bin/bash; so shell scripts won't be able to execute. Instead, use the `/usr/bin/env bash` idiom to reliably find the shell to execute. This fix is only applied to the critical scripts that might be executed on the users' machine; the *_test*sh scripts are left as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
mmh, looks like this does not work in all environments as the CI complains. Setting PR to draft for now and will try to find out what is going on. |
It looks like the So in the simplest case, that I have not fully understood yet where that environment (in |
An old PR ... still relevant, but didn't have time yet. I think these scripts should actually be ported to @UebelAndre did a fantastic job in converting scripts in |
This should also be something LLMs are good at, if you want to give it a try. |
I looked at what I knew to be bash-isms and looked up a pure shell way to do the same thing. I've done a similar conversion in the past to so used my experience there and then ran the tests to observe everything passing. |
So, could you be convinced trying the same here, @UebelAndre ? :) |
Hard-coding the location of the shell to be in
/bin/bash
is not always working as not all Posix-conformant operating systems (such as NixOS) provide the path /bin/bash; so shell scripts won't be able to execute.Instead, use the
/usr/bin/env bash
idiom to reliably find the shell to execute.This fix is only applied to the critical scripts that might be executed on the users' machine; the _testsh scripts are left as-is.