This commit is contained in:
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
set -eu
|
||||
|
||||
repo_root=$(git rev-parse --show-toplevel)
|
||||
hook_path="${repo_root}/.git/hooks/pre-commit"
|
||||
target="${repo_root}/scripts/git-hooks/pre-commit"
|
||||
|
||||
mkdir -p "${repo_root}/.git/hooks"
|
||||
cat > "${hook_path}" <<EOF
|
||||
#!/usr/bin/env zsh
|
||||
exec "${target}" "\$@"
|
||||
EOF
|
||||
|
||||
chmod +x "${hook_path}"
|
||||
echo "Installed git hook: ${hook_path}"
|
||||
Reference in New Issue
Block a user