joyent/node — pull request #3248 by lwille (2012-05-10 11:56:23+00:00)
Title: child_process.fork: allow execPath to be specified.

When running coffee-script files with dev tools like node-dev or testing tools like mocha, execPath is always "node" as these tools are plain js.

To be able to fork a coffee-script child process, I have to modify process.execPath to the path of "coffee":
[process.oldExecPath, process.execPath] = [process.execPath,'/usr/local/bin/coffee']
child = fork modulePath, [], options
process.execPath = process.oldExecPath if process.oldExecPath

This pull request provides child_process.fork with an optional execPath option.