在用Atom寫項目,同時用到grunt作自動化,固然就想到在atom直接調用grunt,有一個現成的atom plugin叫grunt-runner,安裝後,須要配置一下,並且對於mac最新的OS X 10.10還須要特別注意:npm
Find where grunt is in the Terminal:grunt
$ which grunt /usr/local/bin/grunt Add /usr/local/bin to Grunt Paths in the grunt-runner settings.atom
If no path is returned after the which, you have to install Grunt globally through npmspa
Troubleshooting For Yosemite (OS X 10.10)it
If not launched from command-line Atom currently has a bug where it's unable to loads OS X's PATH due to a change in the way Yosemite functions.自動化
You may receive the following error:io
Uncaught BufferedProcessError: Failed to spawn command grunt. Make sure grunt is installed and on your PATHfunction
One workaround is to add the following line:配置
process.env.PATH = ["/usr/local/bin", process.env.PATH].join(":")file
To the file:
~/.atom/init.coffee