diff --git a/lib/server/console.js b/lib/server/console.js index 8d435924..82d8cca2 100644 --- a/lib/server/console.js +++ b/lib/server/console.js @@ -122,6 +122,8 @@ cwd: dir || CWD }; + Util.checkArgs(arguments, ['callback', 'command']); + if (!dir) dir = ClientDirs[connNum] = CWD; @@ -150,11 +152,11 @@ command = 'cmd /C ' + command; if (!ClientFuncs[connNum]) - ClientFuncs[connNum] = Util.exec.with(setExec, function(json, error, stderr) { + ClientFuncs[connNum] = setExec.bind(null, function(json, error, stderr) { log(connNum, error, 'error'); log(connNum, stderr, 'stderror'); - Util.exec(callback, json); + callback(json); }); funcExec = ClientFuncs[connNum]; @@ -182,7 +184,7 @@ function setExec(callback, error, stdout, stderr) { var json, errorStr = ''; - + if (stderr) errorStr = stderr; else if (error) @@ -193,7 +195,7 @@ stderr : errorStr }; - Util.exec(callback, json, error, stderr); + callback(json, error, stderr); } function setSpawn(сommand, options, callback) {