2026-09-24 08:19 UTC
Update: Use `set -euo pipefail`, it comes with stricter checks.
TIL, the importance of having `set -e` inside a Bash script, the hard way.
For those who are curious, `set -e` tells a Bash script to exit if any commands return a non-zero exit status (failure). It is important to have this in pre-commit or pre-deploy scripts. Otherwise, you are relying only on the return value of the last command in the script. If any previous command fails, the script returns a success status.
Thanks @xeno
Replies (0)
No replies.