child_process.fork: allow execPath to be specified. #3248

Closed
wants to merge 1 commit into
from
View
5 lib/child_process.js
@@ -203,7 +203,10 @@ exports.fork = function(modulePath /*, args, options*/) {
// stdin is the IPC channel.
options.stdinStream = createPipe(true);
- var child = spawn(process.execPath, args, options);
+ // default to process.execPath if options.execPath is not provided
+ options.execPath = options.execPath || process.execPath;
+
+ var child = spawn(options.execPath, args, options);
setupChannel(child, options.stdinStream);