-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathfix-hooks.sh
More file actions
36 lines (28 loc) · 1.08 KB
/
fix-hooks.sh
File metadata and controls
36 lines (28 loc) · 1.08 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
#!/bin/bash
# Quick fix to reinstall git hooks
# Run this to fix hook installation issues
set -e
echo "🔧 Updating git hooks to use venv properly..."
# Copy updated pre-commit hook
echo "📋 Installing updated pre-commit hook..."
cp .githooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
# Copy updated pre-push hook
echo "📋 Installing updated pre-push hook..."
cp .githooks/pre-push .git/hooks/pre-push
chmod +x .git/hooks/pre-push
echo "✅ Git hooks updated successfully!"
echo ""
echo "🧪 Testing the updated pre-commit hook..."
if ! command -v poetry >/dev/null 2>&1; then
echo "⚠️ Poetry not found on PATH. Install Poetry first: https://python-poetry.org/docs/#installation"
else
poetry install --with dev,test > /dev/null 2>&1 || true
if poetry run python -c "import ruamel.yaml" 2>/dev/null; then
echo "✅ ruamel.yaml is available in the Poetry environment"
else
echo "⚠️ ruamel.yaml not available. Try: poetry install --with dev,test"
fi
fi
echo ""
echo "🎉 Hooks updated! Your next commit should work properly."