I am following the documentation on creating a Shell script that launches the WebStorm application for a given file folder as described on WebStorm Help page. I am currently using an M1 Pro Macbook (2022) that I just got today and has little else installed beyond Homebrew, VSCode, WebStorm, and PyCharm.
Following the example in the docs, I created a file called webstorm
(without any extension) in usr/local/bin
and added the following code to it:
#!/bin/sh
open -na "WebStorm.app" --args "$@"
After starting up a new terminal, and running webstorm .
, I get the following error in my terminal:
zsh: permission denied: webstorm
I have:
- Changed
sh
tozsh
as my default shell iszsh
, and that made no difference. - Checked my permissions for both
usr/local/bin
andusr/local/bin/webstorm
to ensure that I have the correct permissions to execute files from here. When right clicking on thewebstorm
file and clicking "Get Info", I can see that I currently have read and write permissions. - Restarted my computer
To add to my confusion, I have used the same script in the same location on my work Macbook, and it has worked without issues.
Any help on this would be hugely appreciated.
CodePudding user response:
Checked my permissions for both usr/local/bin and usr/local/bin/webstorm to ensure that I have the correct permissions to execute files from here. When right clicking on the webstorm file and clicking "Get Info", I can see that I currently have read and write permissions.
Do you have the "execution" permission?
Try:
$ chmod x /usr/local/bin/webstorm