open-navigator / scripts /deployment /setup-git-hooks.sh
jcbowyer's picture
Clean HuggingFace deployment without binary files
61d29fc
#!/bin/bash
# Setup script to install git hooks for build protection
# Run this once after cloning the repository
echo "πŸ”§ Setting up git hooks for build protection..."
echo ""
# Create .git/hooks directory if it doesn't exist
mkdir -p .git/hooks
# Copy pre-push hook
if [ -f ".githooks/pre-push" ]; then
cp .githooks/pre-push .git/hooks/pre-push
chmod +x .git/hooks/pre-push
echo "βœ… Installed pre-push hook"
else
echo "❌ Error: .githooks/pre-push not found"
exit 1
fi
echo ""
echo "═══════════════════════════════════════════════════════════"
echo "βœ… Git hooks installed successfully!"
echo "═══════════════════════════════════════════════════════════"
echo ""
echo "What this does:"
echo " β€’ Before each 'git push', runs quick build checks"
echo " β€’ Catches TypeScript errors before they reach CI"
echo " β€’ Prevents broken builds from being pushed"
echo ""
echo "To bypass the hook (emergency only):"
echo " git push --no-verify"
echo ""