-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathpost-checkout
More file actions
executable file
·42 lines (36 loc) · 1.53 KB
/
Copy pathpost-checkout
File metadata and controls
executable file
·42 lines (36 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/zsh
# GoProX Post-Checkout Hook
# Automatically configures Git hooks after cloning or checking out
# Run setup-hooks.zsh to ensure hooks are configured
if [[ -f scripts/maintenance/setup-hooks.zsh ]]; then
echo "[GoProX] Running setup-hooks.zsh to configure git hooks..."
./scripts/maintenance/setup-hooks.zsh
else
echo "[GoProX] setup-hooks.zsh not found, skipping hook setup."
fi
# Run setup-brew.zsh to install Homebrew dependencies (if Homebrew is available)
if command -v brew &> /dev/null; then
if [[ -f scripts/maintenance/setup-brew.zsh ]]; then
echo "[GoProX] Running setup-brew.zsh to install Homebrew dependencies..."
./scripts/maintenance/setup-brew.zsh
else
echo "[GoProX] setup-brew.zsh not found, skipping Homebrew dependency setup."
fi
else
echo "[GoProX] Homebrew not found, skipping Homebrew dependency setup."
fi
# Only run on initial clone (when previous HEAD is empty)
if [[ -z "$2" ]]; then
echo "🔧 Setting up GoProX Git hooks..."
# Configure Git to use .githooks directory
git config core.hooksPath .githooks
echo "✅ Git hooks configured automatically!"
echo " Commit messages will now require GitHub issue references (refs #123)"
echo " Pre-commit checks will run before each commit"
echo " YAML files will be linted (if yamllint is installed)"
echo " Logger usage will be validated in zsh scripts"
echo ""
echo "💡 Optional: Install yamllint for YAML linting:"
echo " brew install yamllint"
echo " or: pip3 install yamllint"
fi