Skip to content

Commit 931d500

Browse files
committed
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
1 parent 725a409 commit 931d500

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/monitor/run.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ function run(options) {
142142

143143
// exit the monitor, but do it gracefully
144144
if (signal === 'SIGUSR2') {
145-
// restart
146-
restart();
145+
return restart();
147146
} else if (code === 0) { // clean exit - wait until file change to restart
148147
if (runCmd) {
149148
utils.log.status('clean exit - waiting for changes before restart');
@@ -161,13 +160,14 @@ function run(options) {
161160
utils.log.fail('app crashed - waiting for file changes before' +
162161
' starting...');
163162
child = null;
164-
if (config.options.restartable) {
165-
// stdin needs to kick in again to be able to listen to the
166-
// restart command
167-
process.stdin.resume();
168-
}
169163
}
170164
}
165+
166+
if (config.options.restartable) {
167+
// stdin needs to kick in again to be able to listen to the
168+
// restart command
169+
process.stdin.resume();
170+
}
171171
});
172172

173173
run.kill = function (noRestart, callback) {

0 commit comments

Comments
 (0)