Chaining fails if one task returns non-zero


Is it a bug or expected behavior that once npm test fails the subshell exits and it doesn’t run my chained

Automatic email notifications to the author of a broken commit

Logical OR (&&) operator in Bash will make the second command run only if the first command’s exit status is 0, if it’s different from 0 the second command will not be run. Please see this doc for more details.

If you want to always run the second command, I would suggest replacing && with ;. If you want to do something different on a failure, this should work:

command && <handle-success> || <handle-failure>