spawn/shared
A 9d14ef4a19
refactor: reduce complexity in shared/common.sh by extracting helper functions (#1091)
- Extract _log_ssh_wait_progress() from generic_ssh_wait() to reduce nesting
- Extract _log_ssh_wait_timeout_error() to consolidate error handling and troubleshooting output
- Extract _generate_openclaw_json() from setup_openclaw_config() to reduce inline JSON generation complexity
- All helpers are private (prefixed with _) and encapsulate related logic

These refactorings reduce function complexity:
- generic_ssh_wait: 68 lines → 47 lines (31% reduction)
- setup_openclaw_config: 41 lines → 28 lines (32% reduction)

Test results: bash test/run.sh passes (80/80), bun test unaffected by these changes

Agent: complexity-hunter

Co-authored-by: Spawn Refactor Service <refactor@spawn.service>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 04:15:27 -05:00
..
common.sh refactor: reduce complexity in shared/common.sh by extracting helper functions (#1091) 2026-02-14 04:15:27 -05:00
github-auth.sh refactor: decompose ensure_jq and ensure_gh_cli into focused helpers (#994) 2026-02-13 12:14:56 -08:00
key-request.sh security: Fix command injection vulnerability in env var exports (#1086) 2026-02-14 04:01:25 -05:00