Repository navigation
fix(install): install.sh takes --option value, exits with a status for each cause, and narrates and traps with Declare-BashScript's functions - #1039
Merged
David-Noble-at-work merged 5 commits intoOct 10, 2026
Conversation
…ci-lint v2.14.0 (#1037) Lanes 62 and 64 of #916, for #1037 and #1038. The draft plan: install.sh carries the helper's narration and handler and takes its four options with or without '='; Test-InstallScript.sh and generate-portfile.sh embed the helper whole; one pinned commit of the helper feeds every copy, and make check fails when one drifts. install.sh stops with the helper's status for each cause, as the owner ruled 2026-10-09. One question remains: the CI the two tools then need. The installers' requirements are stated in the plan and in the command-line design's section 2: each runs with what ships with its operating system. install.sh with macOS's /bin/bash 3.2 and its own tools, as the owner ruled 2026-10-09; install.ps1 with Windows PowerShell 5.1 and PowerShell 7 alike, as ruled 2026-09-24. golangci-lint's pin moves from v2.13.2 to v2.14.0, part of #1020, ruled 2026-10-09: "update to 2.14 everywhere". v2.13.2 cannot read Go 1.27.2's standard library ("export data version 5 is greater than maximum supported version 4"); CI installs the pinned version, and this Mac, danoble-ud24-1 and danoble-wd11-3 run it. Its gocritic flags two formats in writ's migrate session that wrap a path in back quotes by hand; each takes %#q, which prints the same back-quoted path, and a double-quoted one when the path itself holds a back quote.
…re-BashScript's functions (#1037) Phase 3 of lanes 62 and 64 of #916. scripts/Test-InstallScript.sh and packaging/macports/generate-portfile.sh carry the helper's note, success, error, on_error_or_interrupt and Set-Traps, byte-identical to NobleFactor/noblefactor-ops c942f54's, with the exit statuses each uses, copied by hand: nothing sources or embeds the helper, as the owner ruled 2026-10-09 and 2026-10-10. Each keeps its own option parsing, so each runs where it runs today, and CI stays as it is. The suite reports each check in the helper's form and exits 1 when one fails, 64 on a usage error, 66 when DEVLORE_TEST_DIST lacks this platform's archive, and 70 when make dist fails; its trap is Set-Traps with a cleanup that removes its scratch directory. Its 13 old lines over 120 columns are wrapped, every string they hold unchanged; one line of fixture data, GitHub's own rate-limit message, stays as GitHub sends it. It passed all 249 checks on this Mac, install.sh under macOS's own bash and tools. generate-portfile.sh wrote the Portfile for v0.1.0-dev.20261005182840. The plan records the rulings and the approval: the generator, pin and drift check are gone, the two tools carry the helper's functions rather than the helper, the CI change it needed is moot, and phases 1 to 3 are ticked. The command-line design says install.sh carries copies of the helper's functions, made by hand, and section 9 names its exit statuses.
…s, and takes both option forms (#1037, #1038) Phase 4 of lanes 62 and 64 of #916. install.sh carries the helper's note, success, error, on_error_or_interrupt and Set-Traps, as NobleFactor/noblefactor-ops c942f54 has them, copied by hand, with the six exit statuses it uses: it sources nothing, carries none of the helper's checks for bash 5.3 or GNU getopt, and runs with what ships with macOS. Its narration moves to stderr in the helper's form, its warning is error 0, and each refusal exits with the status of its cause, as ruled 2026-10-09: 64 a usage error; 65 an archive it cannot verify; 69 a missing tool, or GitHub refusing a request, serving a file by another name, or lacking the release; 70 a failed self install; 75 GitHub's spent rate limit; 78 an unsupported platform. Each of --prefix, --base, --team and --personal takes its value as --option value or as --option=value, and one given last with no value is refused by name with 64 (#1038), in a loop that runs on bash 3.2. The usage says both forms and the statuses. The suite's refusals each expect their status, and it passed all 249 checks on this Mac, install.sh under macOS's own bash and tools; under /bin/bash 3.2.57 and bash 5.3.20 alike, install.sh refuses as it should. The plan ticks phase 4, separates its table of statuses from the paragraph after it, and names a file served by another name under 69.
…stall.sh exits with (#1037, #1038) Phase 5 of lanes 62 and 64 of #916. scripts/Test-InstallScript.sh now checks each of --prefix, --base, --team and --personal given last with no value, refused with 64 by name before any download; --base in the space form; an architecture other than amd64 and arm64, 78; a self install that fails, 70, under a prefix whose bin is not writable, as /usr/local/bin is without sudo; an archive with no program DEVLORE_TOOLS names, 65; and --prefix, --personal and --team in the space form installing and registering what the = form does, and --prefix= too. Every message it checks is matched in the helper's form, note's, success's or error's. It passed all 288 of its checks on this Mac, install.sh under macOS's own bash and tools. The getting-started guide shows both forms of each bash flag, and its install command is wrapped to 120 columns. The command-line design's section 2 says install.sh takes both and refuses a value-less option by name, and its status page records the revisions of sections 2 and 9. The plan ticks phase 5, lists the two documents, and shortens its title to 110 columns: at 147 it broke the 120-column rule, reported as anthropics/claude-code#101106.
…e 7 close with the pull request (#1037) The suite passed all 288 checks on this Mac with macOS's own tools and with MacPorts', and on danoble-ud24-1.local against this branch's linux/arm64 archive; install.sh, piped into bash there under a scratch HOME, installed the newest release and registered nothing; and under danoble-wd11-3's Git Bash it refused a value-less option and the platform. The next devlore-cli pull request ticks the CI box and phase 7, as plan 289's were.
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
install.shtakes--prefix,--base,--teamand--personalas--option valueor as--option=value, in a loop that runs on macOS's bash 3.2. One given last with no value is refused by name with 64.--prefix ~/xno longer fails as an unknown argument.self install; 75 GitHub's spent rate limit; 78 an unsupported platform. Every refusal exited 1 before.install.sh,scripts/Test-InstallScript.shandpackaging/macports/generate-portfile.shcarry copies of the helper'snote,success,error,on_error_or_interruptandSet-Traps, as NobleFactor/noblefactor-ops c942f54 has them, made by hand: nothing sources or carries the whole helper, as ruled, andinstall.shstill runs with what ships with macOS. Its narration moves to stderr in the helper's form; the PATH advice and the next steps stay on stdout.%#qformats incmd/writ/writ/migrate/session.go.install.sh's statuses; the getting-started guide shows both forms of each bash flag.Test plan
make checkon Danoble-MBP-A at each of the four commits--keep-path); on danoble-ud24-1.local (bash 5.3.9) against this branch's linux/arm64 archiveinstall.shunder bash 3.2.57 and 5.3.20 on this Mac and Git Bash 5.3.15 on danoble-wd11-3: a value-less option refused with 64, both forms parsed, and Windows refused with 78 before any downloadinstall.shpiped into bash on danoble-ud24-1.local under a scratch HOME: the newest release installed and verified, nothing registered, TMPDIR left emptyPlan:
docs/plans/chore/1037-install-sh-embeds-declare.md. Lanes 62 and 64 of #916. Next: Start-Claude and Start-Claude.ps1, then the settings rollup, lane 8 (#927).Resolves #1037
Resolves #1038
Written with AI assistance.
Signed-off-by: David Noble [email protected]
Assisted-by: Claude Code
Time
Computed by the algorithm of noblefactor-ops#188 at merge.