fix(install): fail fast and guard the beta build path#841
Merged
Conversation
install.sh ran without set -e and with SC2164 suppressed, so a failed `git clone` in the beta path cascaded: the cd failed, ./build.sh ran in the caller's directory, the copy failed, and the script still printed the success message with exit 0. - run under set -euo pipefail; downloads keep their explicit file-check error messages via `|| true` guards - guard the clone explicitly so build.sh can never execute outside the fresh temp clone; clean up and exit 1 with a clear error - replace GNU-only `sed -i -e` (BSD sed reads `-e` as a backup suffix and leaves a stray `bashunit-e` file) with a portable tmp+mv edit, restoring the exec bit the rewrite would otherwise drop - acceptance regression test: a failing clone exits non-zero, prints no success message, and creates nothing in the caller's directory Closes #840 Claude-Session: https://claude.ai/code/session_01JSeB8UzLCpqst55hAK6dED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 Background
Related #840
install.shhad no fail-fast: a failed beta clone cascaded into runningbuild.shin the caller's directory and still printed the install-success message with exit 0.💡 Changes
set -euo pipefail; every failure path aborts with a clear error before the success messagesededit (BSD-i -eleft a stray backup file), keeping the binary executablehttps://claude.ai/code/session_01JSeB8UzLCpqst55hAK6dED