Grunt Console Environment Variables

Hi,

I'm trying out the grunt console new in PHPStorm 8. Some of my grunt tasks require certain environmental variables to be set. How can I configure PHPStorm to set these variables before running the grunt tasks?

Thanks.

3 comments
Comment actions Permalink

There is no way to do this in PHPStorm. But the IDE is normally aware of your system environment variables. What OS are you on? What problems running Grunt have you faced? Do the same tasks run fine in your system console?

0
Comment actions Permalink

I'm using OS X 10.9.4. The tasks run fine when executed in the terminal. However, I understand that the environment variables differ between GUI applications and within the terminal.

Basically a couple of the tasks I run need to know the location of an external program. To make sure that the tasks are portable (i.e the path is not hard coded) it fetches this location from an environment variable.

0
Comment actions Permalink

Yes, indeed on MacOSX the environment variables differ between GUI applications and within the terminal. But the IDE tries to load terminal environment by executing the following command on startup:  

 <your shell> -l -i -c '/Applications/WebStorm.app/bin/printenv.py'


Can you check if the problem persists when running WebStorm from terminal (open -a /Applications/WebStorm.app)?
Also, please check if the workaround mentioned in  http://devnet.jetbrains.com/message/5513463#5513463 helps?
0

Please sign in to leave a comment.