Skip to content

fix(setup): detect gh CLI before calling to prevent silent exit-127 failure#55

Merged
kpatel513 merged 2 commits into
mainfrom
feature/fix-gh-cli-silent-failure
Apr 19, 2026
Merged

fix(setup): detect gh CLI before calling to prevent silent exit-127 failure#55
kpatel513 merged 2 commits into
mainfrom
feature/fix-gh-cli-silent-failure

Conversation

@kpatel513

Copy link
Copy Markdown
Owner
  • fix(setup): detect gh CLI before calling to prevent silent exit-127 failure

kpatel513 and others added 2 commits April 19, 2026 12:37
…ailure

setup.sh used set -euo pipefail but called gh inside a command substitution
with no || true guard. On machines without gh installed, the substitution
exited 127, triggering set -e and killing the script before the read fallback
could prompt for a username.

Fix: check command -v gh first. Warn with install URL if missing. Add
|| true on the gh call as a safety net for the authenticated-but-failing case.

Adds test_gh_not_installed to test-setup.sh: strips gh from PATH, pipes
username via stdin, asserts exit 0 + warning message + .global-config written.

Updates README installer description to reflect new behavior.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e missing gh

PATH restriction failed on GitHub Actions Ubuntu runners where gh is
pre-installed at /usr/bin/gh, so command -v gh still succeeded and the
warning branch was never reached.

GH_BIN=/nonexistent/gh is portable: command -v on an absolute nonexistent
path returns false on both macOS and Linux, reliably triggering the warning.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kpatel513 kpatel513 merged commit 52528ec into main Apr 19, 2026
2 checks passed
@kpatel513 kpatel513 deleted the feature/fix-gh-cli-silent-failure branch April 19, 2026 19:43
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.

1 participant