diff --git a/lib/monitor/run.js b/lib/monitor/run.js index a2a0f29f..48b898f5 100644 --- a/lib/monitor/run.js +++ b/lib/monitor/run.js @@ -86,9 +86,10 @@ function run(options) { if (executable === 'node') { var forkArgs = cmd.args.slice(1); var env = utils.merge(options.execOptions.env, process.env); + stdio.push('ipc'); child = fork(options.execOptions.script, forkArgs, { env: env, - silent: true, + stdio: stdio, }); } else { child = spawn.apply(null, spawnArgs); @@ -237,13 +238,10 @@ function run(options) { callback(); }); } - } else if (!noRestart && executable !== 'node') { + } else if (!noRestart) { // if there's no child, then we need to manually start the process // this is because as there was no child, the child.on('exit') event // handler doesn't exist which would normally trigger the restart. - // - // We only perform this for non-node processes since `fork` automatically - // handles cleanup of child processes when the parent dies. bus.once('start', callback); restart(); } else { diff --git a/lib/monitor/watch.js b/lib/monitor/watch.js index d9f870a5..68220b54 100644 --- a/lib/monitor/watch.js +++ b/lib/monitor/watch.js @@ -79,7 +79,8 @@ function watch() { } watchedFiles.push(file); - total++; + watchedFiles = Array.from(new Set(watchedFiles)); // ensure no dupes + total = watchedFiles.length; debug('watching dir: %s', file); }); watcher.on('ready', function () { @@ -146,8 +147,6 @@ function filterAndRestart(files) { // reset the last check so we're only looking at recently modified files config.lastStarted = Date.now(); - console.log(matched.result); - if (matched.result.length) { if (config.options.delay > 0) { utils.log.detail('delaying restart for ' + config.options.delay + 'ms');