You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@mikansoro figured out the core issue: weep uses SHELL env variable to figure out the shell (os.Getenv("SHELL")).
This is not the correct way of doing so. The SHELL variable indicates the default shell, not necessarily one that is used; like one specified in Shebang line of the script.
Solution: don't rely on the SHELL env. I tried quickly to find a go library that resolves shell correctly, but no luck. What works for me is the following shell command:
sh -c 'ps -p $$ -o ppid='| xargs ps -o comm= -p
This should give the proper shell binary name, like /opt/homebrew/Cellar/fish/3.5.1/bin/fish
igr
changed the title
weep export produces script code that is not working on mac bash 5.1
weep incorrectly detects a shell
Sep 14, 2022
There is no
-g
option for theset
command in Bash 5.1 on mac:This is what worked for me when executing from the bash script:
As you see, I changed the output to:
export NAME=VALUE
format. It would be great if we could get such output as well.
The text was updated successfully, but these errors were encountered: