dev-setup
dev-setup copied to clipboard
For all installation scripts, exit immediately if a command exits with a non-zero status
it's important for a script to exit immediately if a command exits with a non-zero status, otherwise results are unpredictable.
this can be achieved by adding set -e at the beginning of all bash scripts
Today I learned about set -e, thanks :)
My only concern about making this change right away is that there seem to be some edge cases that I haven't thought through yet.
welcome :)
you can also disable and re-enable this behaviour when you expect a command to produce a non-zero exit, by surrounding the command with a set +e and set -e.
set -e
normal_command
normal_command
set +e
command_with_non_zero_exit
set -e
normal_command
normal_command