mirror of
https://github.com/nushell/nushell.git
synced 2026-10-28 17:05:03 +08:00
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`)
13 lines
593 B
Nu
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)"
|
|
}
|
|
}
|