Skip to content

fix(install): fail fast and guard the beta build path#841

Merged
Chemaclass merged 1 commit into
mainfrom
fix/840-harden-install-sh
Jul 19, 2026
Merged

fix(install): fail fast and guard the beta build path#841
Chemaclass merged 1 commit into
mainfrom
fix/840-harden-install-sh

Conversation

@Chemaclass

Copy link
Copy Markdown
Member

🤔 Background

Related #840

install.sh had no fail-fast: a failed beta clone cascaded into running build.sh in the caller's directory and still printed the install-success message with exit 0.

💡 Changes

  • Run under set -euo pipefail; every failure path aborts with a clear error before the success message
  • Guard the beta clone explicitly so the build can never execute outside the fresh temp clone
  • Portable in-place sed edit (BSD -i -e left a stray backup file), keeping the binary executable
  • Acceptance regression test: failed clone exits non-zero and pollutes nothing

https://claude.ai/code/session_01JSeB8UzLCpqst55hAK6dED

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
@Chemaclass Chemaclass added the bug Something isn't working label Jul 19, 2026
@Chemaclass Chemaclass self-assigned this Jul 19, 2026
@Chemaclass
Chemaclass merged commit 1b3d24d into main Jul 19, 2026
40 checks passed
@Chemaclass
Chemaclass deleted the fix/840-harden-install-sh branch July 19, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant