mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(console) setSpawn: "+ " -> setEncoding
This commit is contained in:
parent
a151dbcf6f
commit
77dd63ef7e
1 changed files with 6 additions and 2 deletions
|
|
@ -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 + '');
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue