Skip to content

fix(install): install.sh exits 0 after a successful install, and removes its download directory - #961

Merged
David-Noble-at-work merged 2 commits into
developfrom
fix/958-install-sh-exits-1-after-a
Sep 26, 2026
Merged

David-Noble-at-work merged 2 commits into
developfrom
fix/958-install-sh-exits-1-after-a

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lane 8 of #949. Reported by the owner 2026-09-26.

  • The bug — main's local tmp_dir was gone when the EXIT trap ran; under set -u the trap failed with tmp_dir: unbound variable, every successful install exited 1, and the download directory was never removed.
  • The fix — TMP_DIR at script scope; a cleanup function trapped on EXIT before anything can fail removes it when set. Nothing else in the script changes.
  • Plan — 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

  • Before, scratch TMPDIR/XDG_*/--prefix: exit 1, the unbound-variable line, one directory left
  • After: exit 0, no unbound line, TMPDIR empty, writ --version → 5509da4d
  • A failing run (DEVLORE_VERSION=v0.0.0-no-such-tag): exit 1, TMPDIR empty
  • star lint shell ., shellcheck clean
  • After the merge: the release sync carries the fixed script to the site; a run from the develop environment exits 0

Time

Marker UTC Elapsed
opened (first commit) 2026-09-26T20:25:44Z —
submitted (PR opened) 2026-09-26T23:24:28Z 3 h after opened
merged 2026-09-26T23:36:40Z 0.2 h after submitted; 3.2 h in all

Computed by the algorithm of noblefactor-ops#188 at merge.

…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
@David-Noble-at-work
David-Noble-at-work merged commit 9cd1e95 into develop Sep 26, 2026
13 checks passed
@David-Noble-at-work
David-Noble-at-work deleted the fix/958-install-sh-exits-1-after-a branch September 26, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install.sh exits 1 after a successful install, and leaves its download directory behind: the exit trap names a local that is gone

1 participant