Skip to content

Commit acdf048

Browse files
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 boop
1 parent 5565949 commit acdf048

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,4 @@ If ${VERSION} was released moments ago its archives may still be uploading — r
267267
fi
268268
}
269269

270-
main "$@" || exit 1
270+
main "$@"

0 commit comments

Comments
 (0)