refactor(console) setSpawn: "+ " -> setEncoding

This commit is contained in:
coderaiser 2014-06-27 07:47:37 -04:00
parent a151dbcf6f
commit 77dd63ef7e

View file

@ -213,7 +213,7 @@
Util.exec(callback, exec);
},
sendError = function(error) {
send(error + '', null);
send(error, null);
};
сommand = args.shift();
@ -225,11 +225,15 @@
if (error) {
sendError(error);
} else {
cmd.stderr.setEncoding('utf8');
cmd.stdout.setEncoding('utf8');
cmd.stdout.on('data', function(data) {
send(null, data + '');
send(null, data);
});
cmd.stderr.on('data', sendError);
cmd.on('error', function(error) {
var errorStr = addNewLine(error + '');