Repository navigation
fix(install): install.sh exits 0 after a successful install, and removes its download directory - #961
Merged
Conversation
…ves its download directory main declared `local tmp_dir` and trapped `rm -rf "$tmp_dir"` on EXIT. The trap fires after main has returned, when the local is gone; under set -u the expansion failed -- "tmp_dir: unbound variable" -- so every successful install exited 1, and the cleanup never ran, leaving the download directory in $TMPDIR. Reported by the owner on 2026-09-26. TMP_DIR lives at script scope and a cleanup function, trapped on EXIT before anything can fail, removes it when set. Verified in scratch TMPDIR, XDG and prefix: a successful install exits 0 and leaves nothing; a failing one (an unknown tag) exits 1 and leaves nothing. rm -rf and mktemp -d keep their short forms: the script runs on macOS, whose BSD tools have none. Resolves #958 Claude-Session: https://claude.ai/code/session_01DuNfZFyfxBoD9pdaiDEMrY
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.
Summary
Lane 8 of #949. Reported by the owner 2026-09-26.
main'slocal tmp_dirwas gone when the EXIT trap ran; underset -uthe trap failed withtmp_dir: unbound variable, every successful install exited 1, and the download directory was never removed.TMP_DIRat script scope; acleanupfunction trapped on EXIT before anything can fail removes it when set. Nothing else in the script changes.docs/plans/fix/958-install-sh-exits-1-after-a.md; its last box closes when the site's develop environment serves the fixed script.Resolves #958
Test plan
TMPDIR/XDG_*/--prefix: exit 1, the unbound-variable line, one directory leftTMPDIRempty, writ--version→5509da4dDEVLORE_VERSION=v0.0.0-no-such-tag): exit 1,TMPDIRemptystar lint shell ., shellcheck cleanTime
Computed by the algorithm of noblefactor-ops#188 at merge.