Repository navigation
install.sh and two repository tools carry copies of Declare-BashScript's functions and trap through its on_error_or_interrupt #1037
Description
Ruled 2026-10-08. The owner's acceptance for the helper's trap handler, NobleFactor/noblefactor-ops#268: "We will accept the trap logic when all bash scripts in base, team, and main that have trap logic using the Declarre-BashScript trap logic." Of this repository's installer: "We have a DevLore-cli install.sh script that could embed Declare-BashScript but should not source it." Offered taking now the five bash files that trap without the helper, the installers and this repository's two tools embedding it: "All five now".
Three of the five are here (surveyed 2026-10-08, here-documents excluded):
| File | Trap today |
|---|---|
install.sh |
trap cleanup EXIT, line 77 |
packaging/macports/generate-portfile.sh |
trap 'rm -f "$TMPFILE"' EXIT, line 26 |
scripts/Test-InstallScript.sh |
trap 'rm -rf "$scratch"' EXIT, line 67 |
install.sh runs as curl ... | bash on a machine with nothing deployed, so no helper stands beside it. The two tools run in this public repository, where an outside contributor has no base layer (#484). Each carries copies of the helper's functions rather than sourcing it: ruled 2026-10-10, nothing embeds the whole helper, and the copies are made by hand from the helper as it is today.
Ruled 2026-10-09: install.sh's part
Told that the helper parses options with GNU getopt, which a fresh Mac lacks, so install.sh could share its parsing only through an argument parser of our own, the owner: "I do not want to maintain an argument parser without a drop-dead good reason and I'm not sure that macOS is a good enough reason." Then: "The update to install.sh will be two things: updated narration methods that match Declare-BashScript; updated arg processing to allow space or equal." The second is #1038. Asked whether install.sh's trap, and the two tools, still move onto the helper's handler: "Add the helper's handler to the list of changes."
Done when
- each of the three carries copies of
Declare-BashScript's functions, made by hand from the helper as it is today (ruled 2026-10-10), and traps through its handler, stating its own cleanup - how an embedded copy is kept identical to the base's is settled in the plan, and holds: by hand, as needed, ruled 2026-10-09 ("the helper functions we need can be updated manually as needed")
scripts/Test-InstallScript.shpasses against the changedinstall.shinstall.shtakes each of its options as--option valueas well as--option=value(install.sh takes its options only as --option=value: --prefix ~/x is refused as an unknown argument #1038, ruled 2026-10-09: "1")install.sh's narration functions match the helper's (ruled 2026-10-09)
Waits on NobleFactor/noblefactor-ops#268. The other two of the five go with it: the base's scripts/setup-ground-zero.sh in NobleFactor/noblefactor-ops#268, and personal's Install-NFBuildTools in David-Noble-at-work/personal#266.
Plan and design documents
| Kind | Document |
|---|---|
| Plan | docs/plans/chore/1037-install-sh-embeds-declare.md |
| Design | docs/architecture/10-command-line-interface.md, § 2, The installers |
Epic: NobleFactor/noblefactor-ops#142 · Feature: NobleFactor/noblefactor-ops#266
Activity
feat(declare-bashscript): one trap handler, set with Set-Traps; bash …
chore(declare-bashscript): GNU getopt checked as bash is, require_com…
[-]install.sh and two repository tools embed Declare-BashScript and trap through its on_error_or_interrupt[/-][+]install.sh and two repository tools carry copies of Declare-BashScript's functions and trap through its on_error_or_interrupt[/+]chore: the two repository tools narrate and trap with copies of Decla…
chore: install.sh narrates, traps and exits as Declare-BashScript doe…
chore: the install suite checks both option forms and every status in…
docs(plan): phase 6's suite and end-to-end boxes; the CI box and phas…