feat: Add post-push hook to auto-install bd CLI after git push
Hook automatically rebuilds and installs bd CLI when Go files change. Usage in new clones: ./scripts/install-hooks.sh Files: - scripts/hooks/post-push: Hook that runs go install after successful push - scripts/install-hooks.sh: Installer to set up hooks in new clones 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
17
scripts/hooks/post-push
Executable file
17
scripts/hooks/post-push
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
# Post-push hook: Rebuild and install bd CLI after successful push
|
||||
|
||||
set -e
|
||||
|
||||
# Check if any Go files changed in the push
|
||||
# Use the reflog to find what was just pushed
|
||||
if git log --name-only -1 origin/main..HEAD 2>/dev/null | grep -q '\.go$' || \
|
||||
git diff --name-only HEAD~1 HEAD 2>/dev/null | grep -q '\.go$'; then
|
||||
echo ""
|
||||
echo "Go files changed, rebuilding bd CLI..."
|
||||
go install ./cmd/bd
|
||||
echo "✓ bd CLI installed successfully"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user