rename toolkit's set-git-hooks to setup-git-hooks (#8897)

# Description
this pr renames toolkit's `set-git-hooks` to `setup-git-hooks` to match
[CONTRIBUTING.md](cbedc8403f/CONTRIBUTING.md (L112))
This commit is contained in:
mike 2023-04-16 04:39:52 +03:00 committed by GitHub
parent cbedc8403f
commit 6b3236715b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -231,16 +231,16 @@ export def "check pr" [
# set up git hooks to run: # set up git hooks to run:
# - `toolkit fmt --check --verbose` on `git commit` # - `toolkit fmt --check --verbose` on `git commit`
# - `toolkit fmt --check --verbose` and `toolkit clippy --verbose` on `git push` # - `toolkit fmt --check --verbose` and `toolkit clippy --verbose` on `git push`
export def set-git-hooks [] { export def setup-git-hooks [] {
if $nu.os-info.name == windows { if $nu.os-info.name == windows {
return (print "This git hook isn't available on Windows. Sorry!") return (print "This git hook isn't available on Windows. Sorry!")
} }
print "This command will change your local git configuration and hence modify your development workflow. Are you sure you want to continue? [y]" 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" { if (input) == "y" {
print $"running ('toolkit set-git-hooks' | pretty-print-command)" print $"running ('toolkit setup-git-hooks' | pretty-print-command)"
git config --local core.hooksPath .githooks git config --local core.hooksPath .githooks
} else { } else {
print $"aborting ('toolkit set-git-hooks' | pretty-print-command)" print $"aborting ('toolkit setup-git-hooks' | pretty-print-command)"
} }
} }