Commit acdf048
committed
fix: stop suppressing errexit for the whole install
POSIX ignores -e for every command of an AND-OR list but the last, and that
suppression covers the entire body of a function called there. So `main "$@" ||
exit 1` disabled set -e for the whole script: tar, mkdir, chmod and mv could
all fail unnoticed. Reinstalling over an existing binary with a corrupt archive
printed the success message and exited 0.
The idiom came from rustup and cargo-dist, which set -u only and wrap every
command in `ensure`, so the trailing `|| exit 1` costs them nothing. It is not
transferable to a script that relies on -e.
beep boop1 parent 5565949 commit acdf048
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
0 commit comments