feat(installer): use resq hooks install with fallback to dev install-hooks#8
Conversation
…lback
Swap scripts/install-hooks.{sh,ps1} to the new consolidated command paths
introduced in resq-software/crates#60:
resq hooks install (was: resq dev install-hooks)
resq hooks scaffold-local (was: resq dev scaffold-local-hook)
Both scripts probe `--help` for the new paths first and fall back to the
legacy `dev` paths if the user's resq binary pre-dates the consolidation
(e.g. a cached v0.2.6). The legacy paths still work too — they just print
a deprecation warning. No user-facing break.
README + AGENTS snippets updated to show the new canonical paths.
Smoke-tested end-to-end with a master-built resq: the `hooks install`
path is taken silently; hooks land in .git-hooks/; local-pre-push
scaffold prompts as expected.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 8 minutes and 10 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request updates the documentation and installation scripts to transition from legacy resq dev subcommands to the new resq hooks command structure. The scripts now include logic to detect command support and fall back to legacy versions for older binaries to maintain backward compatibility. Review feedback suggests improving the error reporting in both the shell and PowerShell scripts by dynamically referencing the command that actually failed, rather than hardcoding the new command name in warning messages when a fallback was used.
| || printf 'warn scaffold-local-hook failed; run it manually with --kind <name>.\n' >&2 | ||
| # shellcheck disable=SC2086 | ||
| (cd "$TARGET_ROOT" && "$RESQ_BIN" $scaffold_cmd --kind auto) \ | ||
| || printf 'warn scaffold-local failed; run it manually with --kind <name>.\n' >&2 |
There was a problem hiding this comment.
The warning message hardcodes the new command name scaffold-local. If the script falls back to the legacy dev scaffold-local-hook and that command fails, the warning will suggest running a command (scaffold-local) that the user's current binary does not support. It would be better to use the command name that was actually attempted.
| || printf 'warn scaffold-local failed; run it manually with --kind <name>.\n' >&2 | |
| || printf 'warn %s failed; run it manually with --kind <name>.\n' "$scaffold_cmd" >&2 |
| & $resqBin @scaffoldArgs --kind auto | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host 'warn scaffold-local-hook failed; run it manually with --kind <name>.' -ForegroundColor Yellow | ||
| Write-Host 'warn scaffold-local failed; run it manually with --kind <name>.' -ForegroundColor Yellow |
There was a problem hiding this comment.
Similar to the bash script, this warning message hardcodes scaffold-local. If the fallback command dev scaffold-local-hook was used and failed, the user is directed to run a command their binary likely doesn't support. Using the actual command attempted from $scaffoldArgs would be more accurate.
Write-Host "warn $($scaffoldArgs -join ' ') failed; run it manually with --kind <name>." -ForegroundColor Yellow
Summary
Companion to resq-software/crates#60. Swap
scripts/install-hooks.{sh,ps1}to call the new consolidated paths:resq hooks install(wasresq dev install-hooks)resq hooks scaffold-local(wasresq dev scaffold-local-hook)Forward-compatible fallback
Both scripts
--help-probe the new paths first. If the user's resq binary pre-dates #60 (e.g. a cachedresq-cli-v0.2.6), the fallback uses the legacydevpaths, which still work because #60 kept them as deprecated aliases. No user-facing break regardless of which resq version they have installed.Docs updated
README + AGENTS snippets now show the new canonical paths.
Test plan
shellcheck -S warning scripts/install-hooks.shclean🤖 Generated with Claude Code