Skip to content

fix(init): skip redundant hook warning during rtk init#1013

Open
andeart wants to merge 1 commit intortk-ai:developfrom
andeart:fix/redundant-init-warning
Open

fix(init): skip redundant hook warning during rtk init#1013
andeart wants to merge 1 commit intortk-ai:developfrom
andeart:fix/redundant-init-warning

Conversation

@andeart
Copy link
Copy Markdown

@andeart andeart commented Apr 4, 2026

Summary

This fixes #1011.

  • Skip maybe_warn() hook check when the command is Init, since it's about to install/update hooks itself
  • Print [rtk] Installing RTK hook instead of the misleading "No hook installed" warning
  • Matches existing pattern where Gain already skips the check

Test plan

  • Pre-test: clean up any previous markers first, with rtk init -g --uninstall and rm ~/Library/Application\ Support/rtk/.hook_warn_last, then rebuild the binary.
  • cargo fmt --all && cargo clippy --all-targets && cargo test. All pass.
  • Manual testing: rtk init -g output inspected. The message now reads "Installing RTK hook" instead of "No hook installed".

Important: All PRs must target the develop branch (not master).
See CONTRIBUTING.md for details.

When running `rtk init -g`, the hook check would fire before init
had a chance to install the hook, printing a confusing "No hook
installed - run rtk init -g" message. Replace that with an
"Installing RTK hook" message for Init, matching how Gain already
skips the check.
@andeart andeart marked this pull request as ready for review April 4, 2026 05:50
@andeart andeart changed the title Skip redundant hook warning during rtk init fix(init): skip redundant hook warning during rtk init Apr 4, 2026
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