mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-05 23:50:48 +00:00
Extract platform-specific install logic from monolithic installer functions into small, focused helpers. Both functions had nested OS/package-manager cascades (depth 3-4) that made the control flow hard to follow. ensure_jq (shared/common.sh): - Extract _install_jq_brew, _install_jq_apt, _install_jq_dnf, _install_jq_apk - Extract _report_jq_not_found for the fallthrough error message - Main function becomes a clean dispatcher + verification ensure_gh_cli + _install_gh_binary (shared/github-auth.sh): - Extract _install_gh_brew, _install_gh_apt, _install_gh_dnf - Extract _detect_gh_platform, _fetch_gh_latest_version, _download_and_install_gh - _install_gh_binary drops from 71 to 12 lines as a clean orchestrator - ensure_gh_cli drops from 57 to 29 lines No behavior changes. All tests pass, bash -n passes. Agent: complexity-hunter Co-authored-by: A <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| common.sh | ||
| github-auth.sh | ||
| key-request.sh | ||