fixed #289. setTimeout to the rescue?

This commit is contained in:
Remy Sharp
2014-04-04 10:50:57 +01:00
parent bb6a886dbf
commit 59a5851552
2 changed files with 11 additions and 1 deletions

View File

@@ -115,7 +115,14 @@ function run(options) {
if (process.stdin.unpipe) { // node > 0.8
process.stdin.unpipe(child.stdin);
}
child.stdin.end();
// this seems to fix the 0.11.x issue with the "rs" restart command,
// though I'm unsure why. it seems like more data is streamed in to
// stdin after we close, so doing it on nextTick ala setTimeout(0)
// seems to fix it.
process.nextTick(function () {
child.stdin.end();
});
}
// When using CoffeeScript under Windows, child's process is not node.exe

View File

@@ -222,6 +222,9 @@ if (!config.required) {
console.error('exception in nodemon killing node');
console.error(err.stack);
console.error();
console.error('node: ' + process.version);
console.error('command: ' + process.argv.join(' '));
console.error();
console.error('If appropriate, please file an error: http://github.com/remy/nodemon/issues/new\n');
if (!config.required) {
process.exit(1);