I have this line in a bash script:
$ node $(node `dirname $0`/foo.js) "$@"
In foo.js, I have
if(x){
process.exit(0);
}
else{
process.exit(1);
}
I want the bash script to abort / error out, if the process defined by
$(node `dirname $0`/foo.js)
exits with a non-zero exit code.
How can I do this?