Skip to content

Commit

Permalink
Merge pull request remy#65 from kurakin/master
Browse files Browse the repository at this point in the history
add option to disable reading from stdin
  • Loading branch information
remy committed Feb 14, 2012
2 parents 449175f + 60ebbdc commit fb0bed5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions nodemon.js
Expand Up @@ -65,9 +65,11 @@ function startNode() {
});

// pinched from https://github.com/DTrejo/run.js - pipes stdin to the child process - cheers DTrejo ;-)
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.pipe(child.stdin);
if (program.options.stdin) {
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.pipe(child.stdin);
}

setTimeout(startMonitor, timeout);
}
Expand Down Expand Up @@ -213,7 +215,8 @@ function getNodemonArgs() {
verbose: true,
js: false, // becomes the default anyway...
includeHidden: false,
exitcrash: false
exitcrash: false,
stdin: true
// args: []
};

Expand All @@ -238,6 +241,8 @@ function getNodemonArgs() {
options.delay = parseInt(args.shift());
} else if (arg === '--exec' || arg === '-x') {
options.exec = args.shift();
} else if (arg === '--no-stdin' || arg === '-I') {
options.stdin = false;
} else { //if (arg === "--") {
// Remaining args are node arguments
appargs.push(arg);
Expand Down Expand Up @@ -439,4 +444,4 @@ path.exists(ignoreFilePath, function (exists) {
} else {
readIgnoreFile();
}
});
});

0 comments on commit fb0bed5

Please sign in to comment.