cloudaxe-opencode/script/hooks

17 lines
278 B
Text
Raw Normal View History

#!/bin/sh
2025-06-19 04:20:03 +00:00
if [ ! -d ".git" ]; then
exit 0
fi
mkdir -p .git/hooks
cat > .git/hooks/pre-push << 'EOF'
#!/bin/sh
bun prettier --write --ignore-unknown $(git diff --name-only HEAD~1 HEAD)
2025-06-19 04:20:03 +00:00
bun run typecheck
EOF
chmod +x .git/hooks/pre-push
echo "✅ Pre-push hook installed"