Open depp opened 2 years ago
It looks like the cause is that if you’re running a shell script, the process name is the name of the shell script, not the name of the shell. At least on Linux. It is easy enough to circumvent this by creating a subshell.
So, here's a workaround:
eval "$(sh -c 'frum init')"
I was trying to run ruby commands from a cron job script but ran into this same scenario. However the above workaround still produces the same not found
output for me.
This is an awful workaround, but it seems to get the job done:
ruby="/tmp/$(ls -t /tmp/ | grep frum_ | head -n 1)/bin/ruby"
I’m not sure what the exact cause is here.
Here is
test.sh
, which is executable:If this script is run from zsh, the shell is detected as zsh, even though this command is running from a dash process.
I can run it from Bash, however:
At first I thought this was because the script was running inside
dash
, which is not handled in the shell detector. However, it seems that Frum simply doesn’t detect the shell when the shell is running a script:This fails too, when invoked from zsh.
Thinking of a few ways my issue could be solved:
frum init --shell=sh
)frum exec
)