NodeFly/node-foreman — pull request #27 by kainosnoema (2013-07-07 23:48:36+00:00)
Title: Replace custom env variable parsing with proper shell execution

Because env parsing is unreliable at best, and executing the command using child_process.exec and the proper env variables lets the shell do its thing.

By using child_process.exec, we also get the benefit of allowing quoted arguments and subshell execution like the following: `web: sh -c 'supervisor -e "node|js|json" ./server.js'`. Previously, the whitespace splitting would mangle the quoted arguments and the command would fail.

Tested on OS X and Windows, resolves issues #6, #24, #26 and maintains compatibility with #20 and #21. Also fixes a single bug with Node v0.6.x (since the `package.json` says we should support it).

I'd love to add some tests for this behavior since it's pretty important, but there are no tests in the project currently, and I didn't want to make that call. If you're open to using [mocha](http://visionmedia.github.io/mocha), I'd be happy to start a test suite with this PR as well. Thoughts?