Home > Net >  zsh: permission denied: webstorm - On Attempting to Create Shell Script That Launches WebStorm
zsh: permission denied: webstorm - On Attempting to Create Shell Script That Launches WebStorm

Time:07-06

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:

  1. Changed sh to zsh as my default shell is zsh, and that made no difference.
  2. 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.
  3. 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
  • Related