Hide Output when using callbacks
woverton opened this issue · comments
William Overton commented
Why does this code print out the output to the screen?
NodeBuilder.prototype.runSshCommand = function(ip, user, command, callback) {
sequest('user@' + ip, {
command: command,
privateKey: this.awsKey
}, function(err, stdout) {
if (err) {
callback(err);
return;
}
callback(null, null);
})
}
NodeBuilder.prototype.doTheTheThing = function(callback){
this.runSshCommand("xxx.xxx.xxx.xxx", "(echo n; echo p; echo 2; echo ; echo ; echo w) | fdisk /dev/sdb2", function(err, data) {
callback(err, null);
});
}