From 8a0ce0941ff60f58121137fd9ea93fa2c6cb6e4a Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Wed, 23 Sep 2015 08:34:38 +0100 Subject: [PATCH] fix: `rs` to restart Always unhook the process.stdin when the child has exited, this allows the `rs` command to be read - otherwise it's ignored. Fixes #648 --- lib/monitor/run.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/monitor/run.js b/lib/monitor/run.js index d45aed77..5b534f53 100644 --- a/lib/monitor/run.js +++ b/lib/monitor/run.js @@ -142,8 +142,7 @@ function run(options) { // exit the monitor, but do it gracefully if (signal === 'SIGUSR2') { - // restart - restart(); + return restart(); } else if (code === 0) { // clean exit - wait until file change to restart if (runCmd) { utils.log.status('clean exit - waiting for changes before restart'); @@ -161,13 +160,14 @@ function run(options) { utils.log.fail('app crashed - waiting for file changes before' + ' starting...'); child = null; - if (config.options.restartable) { - // stdin needs to kick in again to be able to listen to the - // restart command - process.stdin.resume(); - } } } + + if (config.options.restartable) { + // stdin needs to kick in again to be able to listen to the + // restart command + process.stdin.resume(); + } }); run.kill = function (noRestart, callback) {