mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
fix(console) getSpawn: mv send up
This commit is contained in:
parent
ccd78ede68
commit
ae5e7ea2ab
1 changed files with 13 additions and 14 deletions
|
|
@ -209,19 +209,9 @@
|
|||
};
|
||||
}
|
||||
|
||||
function getSpawn(pCommand, options, callback) {
|
||||
var send, cmd, error,
|
||||
args = pCommand.split(' ');
|
||||
|
||||
pCommand = args.shift();
|
||||
|
||||
error = Util.tryCatchLog(function() {
|
||||
cmd = spawn(pCommand, args, options);
|
||||
});
|
||||
|
||||
if (!cmd)
|
||||
send(error + '', null);
|
||||
else {
|
||||
function getSpawn(сommand, options, callback) {
|
||||
var cmd, error,
|
||||
args = сommand.split(' '),
|
||||
send = function(error, data) {
|
||||
var exec = {
|
||||
stderr: error,
|
||||
|
|
@ -230,7 +220,16 @@
|
|||
|
||||
Util.exec(callback, exec);
|
||||
};
|
||||
|
||||
|
||||
сommand = args.shift();
|
||||
|
||||
error = Util.tryCatchLog(function() {
|
||||
cmd = spawn(сommand, args, options);
|
||||
});
|
||||
|
||||
if (!cmd)
|
||||
send(error + '', null);
|
||||
else {
|
||||
cmd.stdout.on('data', function(data) {
|
||||
send(null, data + '');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue