diff --git a/lib/server/socket.js b/lib/server/socket.js index 06d3473d..466c4298 100644 --- a/lib/server/socket.js +++ b/lib/server/socket.js @@ -242,16 +242,18 @@ } function getSpawn(pCommand, options, callback) { - var send, cmd, + var send, cmd, error, args = pCommand.split(' '); pCommand = args.shift(); - Util.tryCatchLog(function() { - cmd = spawn(pCommand, args, options); + error = Util.tryCatchLog(function() { + cmd = spawn(pCommand, args, options); }); - if (cmd) { + if (!cmd) + send(error + '', null); + else { send = function(error, data) { var exec = { stderr: error,