Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
this._screen.info('$ %s', command)
this._logger.info('RUNNING: %s', command);
shell.exec(command, { async: true },
(code, stdout, stderr) => {
var result = {
code: code, stdout: stdout, stderr: stderr
}
this._logger.info('EXIT CODE: %s', result.code);
if (result.code == 0) {
resolve(result);
}
else {
var errStr = 'ErrorCode: ' + result.code;
if (result.stderr) {
errStr = errStr + ' ERR: ' + result.stderr;
}
if (result.stdout) {
errStr = errStr + ' OUT: ' + result.stdout;
}