chore(ci): bootstrap CI + hooks
Squash-merge bootstrap-cicd into integration
This commit is contained in:
19
scripts/setup-hooks
Executable file
19
scripts/setup-hooks
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
root_dir="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
||||
|
||||
mkdir -p "$root_dir/.git/hooks"
|
||||
|
||||
for hook in pre-commit pre-push commit-msg; do
|
||||
src="$root_dir/.githooks/$hook"
|
||||
dest="$root_dir/.git/hooks/$hook"
|
||||
if [[ -f "$src" ]]; then
|
||||
cp "$src" "$dest"
|
||||
chmod +x "$dest"
|
||||
echo "Installed hook: $hook"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Git hooks installed."
|
||||
|
Reference in New Issue
Block a user