Skip to content

Commit

Permalink
fix: support node arguments again
Browse files Browse the repository at this point in the history
If node is being passed any arguments (before the script) then use
spawn instead of fork.

Fixes #1161
  • Loading branch information
remy committed Dec 13, 2017
1 parent 9f8defc commit d9e93ad
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/monitor/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,13 @@ function run(options) {
});
}

if (executable === 'node' && utils.version.major > 4) {
if (
// this is a hack to avoid forking if there's a node argument being passed
// it's a short term fix, and I'm not 100% sure that `fork` is the right way
cmd.args[0].indexOf('-') === -1 &&
executable === 'node' &&
utils.version.major > 4
) {
var forkArgs = cmd.args.slice(1);
var env = utils.merge(options.execOptions.env, process.env);
stdio.push('ipc');
Expand Down

0 comments on commit d9e93ad

Please sign in to comment.