node-triton#52 Fix 'triton ssh ...' stdout/stderr to fully flush with node >= 4.x
Fixes #52
This commit is contained in:
parent
31ef581980
commit
a1df6e0fe7
@ -2,7 +2,7 @@
|
||||
|
||||
## 4.5.3 (not yet released)
|
||||
|
||||
(nothing yet)
|
||||
- #52 Fix 'triton ssh ...' stdout/stderr to fully flush with node >= 4.x.
|
||||
|
||||
|
||||
## 4.5.2
|
||||
|
@ -50,8 +50,19 @@ function do_ssh(subcmd, opts, args, callback) {
|
||||
args = ['-l', user].concat(ip).concat(args);
|
||||
|
||||
self.top.log.info({args: args}, 'forking ssh');
|
||||
var child = spawn('ssh', args, {stdio: 'inherit'});
|
||||
var child = spawn('ssh', args);
|
||||
child.stdout.on('data', function (chunk){
|
||||
process.stdout.write(chunk);
|
||||
});
|
||||
child.stderr.on('data', function (chunk){
|
||||
process.stderr.write(chunk);
|
||||
});
|
||||
child.on('close', function (code) {
|
||||
/*
|
||||
* Once node 0.10 support is dropped we could instead:
|
||||
* process.exitCode = code;
|
||||
* callback();
|
||||
*/
|
||||
process.exit(code);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user