Skip to content

Commit

Permalink
fix: get tests to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
heisian committed Dec 6, 2017
1 parent 3a6b8df commit cf923a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 3 additions & 5 deletions lib/monitor/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 2 additions & 3 deletions lib/monitor/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit cf923a8

Please sign in to comment.