Files
nushell/toolkit/git-hooks.nu
T
rose a6d689d493 Refactor toolkit.nu into module (#16701)
Refactors the toolkit into a module. Was getting a bit large

This PR preserves the actual `toolkit.nu` file by making it `export use
toolkit *`. This way, anyone using `use toolkit.nu` can still expect it
to work the same way. This does have the unfortunate side effect that it
introduces a `toolkit toolkit` command, which does the same thing as
just `toolkit` (i.e., runs `help main`)
2025-09-17 13:53:27 +03:00

13 lines
593 B
Nu

# set up git hooks to run:
# - `toolkit fmt --check --verbose` on `git commit`
# - `toolkit fmt --check --verbose` and `toolkit clippy --verbose` on `git push`
export def setup-git-hooks [] {
print "This command will change your local git configuration and hence modify your development workflow. Are you sure you want to continue? [y]"
if (input) == "y" {
print $"running ('toolkit setup-git-hooks' | pretty-format-command)"
git config --local core.hooksPath .githooks
} else {
print $"aborting ('toolkit setup-git-hooks' | pretty-format-command)"
}
}