-
Notifications
You must be signed in to change notification settings - Fork 744
shjs command always exits with zero code #133
Copy link
Copy link
Closed
Description
Lets write a simple test test.js
process.exit(1)then after i type shjs test.js || echo 1 console gives me no output, but node test.js || echo 1 ended with 1 code as expected. Tested in Linux and Windows.
Maybe I do not catch up something... But obviously shjs must persist exit code from script it running and i see this logic in shjs file, but in ./bin/shjs new child node process doesn't pass exit code to main process. Is the failed child process should not ruin parent process with error exit code? Maybe because it is asynchronous...
So I wait until the subprocess is completed and manualy close main process with the same exit code then all works perfect.
exec('node ' + scriptName + ' ' + args.join(' '), {async: true}, function(code) {
exit(code);
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels