Conversation
This was referenced Sep 23, 2026
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
Every ODS entry-point script runs under
set -euo pipefail, but 13 option parsers read"$2"without checking it exists. Passing a documented value-option as the last argument crashes with$2: unbound variable— no usage hint, and ininstall-core.sh's case the ERR trap prints a misleading "Installation failed during phase: init" banner for what is really a CLI typo.Why this matters
All of these are documented in each script's
--helpoutput, so./install.sh --tier(forgot the tier),ods backup --output(forgot the path),ods-test.sh -s(forgot the service) are reachable operator errors. The crash also bypasses each script's own error convention (error(),log_error+usage, exit-code contract), which matters for wrappers and CI that parse stderr.Sites fixed (guard convention copied from
ods-uninstall.sh, which already has it):install-core.sh—--tier,--lemonade-url,--lemonade-api-key,--external-llm-url,--external-llm-provider,--external-llm-model,--summary-jsonods-backup.sh—-o|--output,-t|--type,-d|--delete,--descriptionscripts/pre-download.sh—--tierscripts/ods-test.sh—-s|--serviceEach arm now does
[[ $# -ge 2 && -n "$2" ]] || <file's error path>before consuming$2, rejecting both a missing argument and an explicitly empty one.Overlap check
scripts/load-backend-contract.sh; that file already has its guard upstream, and it is not touched here.--lemonade-api-keysemantics (reject without external Lemonade). Adjacent line ininstall-core.sh; trivial one-line conflict whichever lands second.--bootstraparm to the samecaseblock; no line overlap.install-macos.sh(${2:-}) andods-uninstall.sh(explicit$#check) already guard their parsers — verified while scoping; no changes needed there.Regression test
ods/tests/test-option-arg-guards.shruns all 17 flag spellings as trailing arguments and asserts: non-zero exit, nounbound variabletext, and arequires-style error message.Validation
upstream/public-beta(4d725ee95): 0 passed, 17 failed — every site crashes onunbound variable.bash -nandshellcheck -S errorclean on all 5 files;git diff --checkclean.Pending: CI and maintainer review.