Comment

Jeff Harris

`./script/update-internal-links.js --check || echo "Extra message here informing that the script failed"`

Is more concise imo. If the initial return value isn’t 0, the script will echo your message, which will have an exit value of 0.

Replies

Peter Bengtsson

What if you have many things you want to do, if it failed. Not just 1 single `echo`.
Yes, you could use brackets but it'll get a bit messy.

And the remit is to intercept failure, do something with that fact, but still exit with the same exit code as the original script.