From 3feff5035ee9d866faac04a9962ea36de1ea25c4 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Mon, 19 Jan 2015 21:58:49 +0000 Subject: [PATCH] Fixed #468 My old spawn check was based on the minor value being >= 8, of course now io.js is 1.0.2, it wasn't using the new spawn method, and silencing user scripts. --- lib/monitor/run.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/monitor/run.js b/lib/monitor/run.js index c36dd7c..ed48f02 100644 --- a/lib/monitor/run.js +++ b/lib/monitor/run.js @@ -12,7 +12,8 @@ var utils = require('../utils'), noop = function() {}, restart = null, psTree = require('ps-tree'), - nodeMajor = parseInt((process.versions.node.split('.') || [null,null])[1] || 0, 10), + nodeMajor = parseInt((process.versions.node.split('.') || [null,null])[0] || 0, 10), + nodeMinor = parseInt((process.versions.node.split('.') || [null,null])[1] || 0, 10), hasPS = true; // discover if the OS has `ps`, and therefore can use psTree @@ -57,7 +58,9 @@ function run(options) { var args = [cmd.executable].concat(cmd.args).join(' ').trim(); var spawnArgs = [sh, [shFlag, args]]; - if (nodeMajor >= 8) { + if (nodeMajor === 0 && nodeMinor < 8) { + // use the old spawn args :-\ + } else { spawnArgs.push({ env: utils.merge(options.execOptions.env, process.env), stdio: stdio