-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
The patch version 8.6.1 introduces using the SHELL variable if defined.
Except that I use fish, and it defines the SHELL variable to use fish. Now all my scripts are broken because of the following error after running a command (here which sentry-cli)
$ which sentry-cli
set: -euo: unknown option
Standard input (line 1):
set -euo pipefail;which sentry-cli
^
(Type 'help set' for related documentation)
- This change should have been in my opinion at least a minor. It breaks the behavior that zx uses bash to now use the user's SHELL.
- Since using the
SHELLenvironment variable can change the way commands should be run, if aSHELLenv variable is used, shouldn't it reset the$.prefix? - The docs still state that the default for the
$.shellvariable iswhich bash, which isn't true if it uses aSHELLenv variable. - There should be an easy way for reverting to the old behavior from a script. I can't use
$.shell = which bash;since using $`` fails everytime, and I can't hardcode the path to bash since I don't know where it's installed on everyone running my script's machine? Edit: Found out aboutuseBash(), I guess I can add this to all my scripts!
Are you sure this change is valid though? Seems strange to me that by default, zx would run using the user's shell.
zx scripts should be reproducible and therefore use the same shell always, shouldn't they?
cc @antongolub