Problem
bootstrap-repo.sh line 25 checks command -v gh to decide whether to use gh repo clone or git clone. If gh is installed but not authenticated, it enters the gh repo clone branch and fails with an auth error — instead of falling back to git clone.
This is a common scenario: gh may be installed via package manager but never logged in, or the login session may have expired.
Reproduction
- Install
gh but do NOT run gh auth login
- Run
bash scripts/send-file.sh some-file.html
- Expected: falls back to
git clone (which may succeed if git credentials are configured)
- Actual: fails with `To get started with GitHub CLI, please run: gh auth login`
Suggested Fix
Check not just command -v gh but also whether gh is actually authenticated:
if command -v gh >/dev/null 2>&1 && gh auth status &>/dev/null; then
gh repo clone sun-praise/static-html "$repo_dir" -- --branch "$repo_ref"
else
git clone --branch "$repo_ref" "$repo_https_url" "$repo_dir"
fi
This way, if gh exists but is not logged in, it gracefully falls back to git clone.
Problem
bootstrap-repo.shline 25 checkscommand -v ghto decide whether to usegh repo cloneorgit clone. Ifghis installed but not authenticated, it enters thegh repo clonebranch and fails with an auth error — instead of falling back togit clone.This is a common scenario:
ghmay be installed via package manager but never logged in, or the login session may have expired.Reproduction
ghbut do NOT rungh auth loginbash scripts/send-file.sh some-file.htmlgit clone(which may succeed if git credentials are configured)Suggested Fix
Check not just
command -v ghbut also whetherghis actually authenticated:This way, if
ghexists but is not logged in, it gracefully falls back togit clone.