From 7f3846c8e73977b38458d2ad5a49c4e87e258b9f Mon Sep 17 00:00:00 2001 From: Mick Grove Date: Fri, 22 Aug 2025 17:33:03 -0700 Subject: [PATCH] Added a new install-precommit subcommand that installs a git pre-commit hook, prompting or accepting --global/--repo flags to control scope and configuring the hook to run kingfisher --quiet --only-valid --no-update-check --- README.md | 2 +- src/cli/commands/precommit.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 272c67a..32eaac2 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ make all # builds for every OS and architecture supported ### Install as a Git pre-commit hook Run `kingfisher precommit --install` to set up a Git pre-commit hook that runs -`kingfisher --quiet --only-valid --no-update-check` before each commit. +`kingfisher scan --quiet --only-valid --no-update-check` before each commit. Use `--global` to operate on all repositories or `--repo` to target only the current repository without prompting. Remove the hook with `kingfisher precommit --remove`. diff --git a/src/cli/commands/precommit.rs b/src/cli/commands/precommit.rs index a6a1f0a..4589d18 100644 --- a/src/cli/commands/precommit.rs +++ b/src/cli/commands/precommit.rs @@ -214,9 +214,9 @@ fn hook_content() -> String { fn hook_call_line() -> String { if cfg!(windows) { - "kingfisher --quiet --only-valid --no-update-check %*".to_string() + "kingfisher scan --quiet --only-valid --no-update-check %*".to_string() } else { - "kingfisher --quiet --only-valid --no-update-check \"$@\"".to_string() + "kingfisher scan --quiet --only-valid --no-update-check \"$@\"".to_string() } }