dustinrue / ControlPlane

ControlPlane - context-sensitive computing for OS X

Home Page:http://www.controlplaneapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Run a Shell Script broken if the default shell is zsh

noaho opened this issue · comments

Hi,

I can't run shell scripts with controlplane, I just get (script terminated with a non-zero status '127') even if I use the picker to select the file, and it has correct permissions (755).

Another user reported the same problem while having zsh as his default shell, so I believe this to be related to the problem.

#443 (comment)

Same here with fish shell

You may be able to work around this by specifying the full path of any executables in your script. You can get the path of an application by doing command -v name, e.g., command -v python3 returns /usr/local/bin/python3.

ControlPlane is executing the shellscript in bash, I guess the idea would be to add the opportunity to choose which shell you want to use to execute the scripts.

In the meantime, you can call your command like this
/bin/zsh -i -c "the command that works in your shell"

-i make the shell interactive, and will read your $HOME/.zshrc file
-c run the command after
You don't need the double quote if your command doesn't have any arguments

That will be bullet proof since it's also working in zsh also. The only thing is that you are loading the shell each time.