mirror of
https://github.com/shelljs/shelljs.git
synced 2026-01-18 16:03:37 +00:00
exec: don't output error msg when exit code > 0
This commit is contained in:
parent
b932ad1f18
commit
8df40dcf10
@ -31,7 +31,8 @@ function error(msg, _continue) {
|
||||
state.error = '';
|
||||
state.error += state.currentCmd + ': ' + msg + '\n';
|
||||
|
||||
log(state.error);
|
||||
if (msg.length > 0)
|
||||
log(state.error);
|
||||
|
||||
if (config.fatal)
|
||||
process.exit(1);
|
||||
|
||||
@ -84,7 +84,7 @@ function execSync(cmd, opts) {
|
||||
|
||||
// some shell return codes are defined as errors, per http://tldp.org/LDP/abs/html/exitcodes.html
|
||||
if (code === 1 || code === 2 || code >= 126) {
|
||||
common.error('Exec returned error code' + code, true);
|
||||
common.error('', true); // unix/shell doesn't really give an error message after non-zero exit codes
|
||||
}
|
||||
// True if successful, false if not
|
||||
var obj = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user