mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-13 12:37:17 +08:00
fixed broken stdin
This commit is contained in:
@@ -51,9 +51,9 @@ Monitor.prototype.start = function (fn) {
|
||||
} else {
|
||||
start.apply(this, arguments);
|
||||
}
|
||||
if(!(this.child.stdout && this.child.stdin && this.child.stderr)) {
|
||||
|
||||
if(!(this.child.stdout && this.child.stderr)) {
|
||||
this.child.stdout = process.stdout;
|
||||
this.child.stdin = process.stdin;
|
||||
this.child.stderr = process.stderr;
|
||||
}
|
||||
|
||||
@@ -109,15 +109,15 @@ Monitor.createCommands = function (commands) {
|
||||
}
|
||||
|
||||
Monitor.createMonitor = function (config) {
|
||||
var opts = {stdio: [process.stdin, process.stdout, process.stderr, 'ipc']}
|
||||
var opts = {stdio: ['pipe', process.stdout, process.stderr, 'ipc']}
|
||||
, monitor = new Monitor(__dirname + '/start.js', opts)
|
||||
, server = new EventEmitter();
|
||||
|
||||
keypress(process.stdin);
|
||||
server.options = config;
|
||||
|
||||
server.listen = function () {
|
||||
monitor.start(function (err, commands, restarting) {
|
||||
keypress(process.stdin);
|
||||
commands.start(config, function (err) {
|
||||
if(err) {
|
||||
server.emit('error', err);
|
||||
|
||||
@@ -133,7 +133,6 @@ function Server(options) {
|
||||
});
|
||||
|
||||
server.on('request:error', function (err, req, res) {
|
||||
console.error(res.finished, 'finished...');
|
||||
console.error();
|
||||
console.error(req.method, req.url, err.stack || err);
|
||||
process.exit();
|
||||
|
||||
Reference in New Issue
Block a user