mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(console) stringfyJSON(error) -> error.message
This commit is contained in:
parent
f41ff4bbca
commit
4c9e9fbfec
1 changed files with 12 additions and 12 deletions
|
|
@ -175,10 +175,12 @@
|
|||
*/
|
||||
function setExec(callback, error, stdout, stderr) {
|
||||
var json,
|
||||
errorStr = stderr || error;
|
||||
|
||||
if (errorStr)
|
||||
errorStr = addNewLine(errorStr + '');
|
||||
errorStr = '';
|
||||
|
||||
if (stderr)
|
||||
errorStr = stderr;
|
||||
else if (error)
|
||||
errorStr = error.message;
|
||||
|
||||
json = {
|
||||
stdout : stdout,
|
||||
|
|
@ -283,16 +285,14 @@
|
|||
command = 'cd ' + path.join(currDir, paramDir);
|
||||
|
||||
exec(command + ' && ' + getDir, {cwd : currDir}, function (error, stdout, stderr) {
|
||||
var errorStr = '',
|
||||
errorData = stderr || error,
|
||||
isStr = Util.isString(errorData);
|
||||
var errorStr = '';
|
||||
|
||||
if (errorData && !isStr)
|
||||
errorStr = Util.stringifyJSON(errorData);
|
||||
else
|
||||
errorStr = errorData;
|
||||
if (stderr)
|
||||
errorStr = stderr;
|
||||
else if (error)
|
||||
errorStr = error.message;
|
||||
|
||||
callback(errorData, {
|
||||
callback(error || stderr, {
|
||||
stderr : errorStr,
|
||||
path : CloudFunc.rmNewLine(stdout)
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue