scripts/gh.sh fails with "FLAGS[@]: unbound variable" on flagless invocations under macOS bash 3.2

Status Open
Maintainer reply None cached
Activity 1 comment · opened Jul 19, 2026

scripts/gh.sh runs under set -euo pipefail and expands "${FLAGS[@]}" at three call sites (lines 83, 89, 95). When no flags are passed, FLAGS is an empty array, and on bash < 4.4 (macOS ships /bin/bash 3.2) the expansion is treated as an unbound variable under set -u. Every flagless invocation crashes before gh is called, including the script's own usage example:

$ GH_REPO=anthropics/claude-code /bin/bash scripts/gh.sh issue view 123
scripts/gh.sh: line 89: FLAGS[@]: unbound variable

All four allowed subcommands are affected (issue view, issue list, search issues, label list). Flagged invocations work. CI on ubuntu (bash 5) is unaffected; this bites anyone running the wrapper locally on a Mac with stock bash.

The standard guard ${FLAGS[@]+"${FLAGS[@]}"} at the three call sites fixes it without behavior change on newer bash. Happy to open a PR.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗