Files
uno-q-audio-synth/.githooks/pre-push
T
david 0382450f8b
Validate and Test / validate-patches (push) Failing after 12s
feat: add git hooks for pre-push validation and post-merge auto-deploy
- .githooks/pre-push: validate Pd patches via python3 pd-validator
- .githooks/post-merge: auto-restart services when systemd/scripts change
- install.sh: configure core.hooksPath at install time
- justfile deploy: set hooksPath after git pull
2026-06-24 03:19:51 -07:00

24 lines
652 B
Bash
Executable File

#!/bin/bash
# pre-push: validate Pd patches before pushing
set -euo pipefail
REPO="$(cd "$(dirname "$0")/.." && pwd)"
# Only check if there are any .pd files staged or changed
STAGED_PD=$(git diff --cached --name-only -- '*.pd' 2>/dev/null || true)
CHANGED_PD=$(git diff --name-only -- '*.pd' 2>/dev/null || true)
if [ -z "$STAGED_PD" ] && [ -z "$CHANGED_PD" ]; then
exit 0
fi
echo "[githook:pre-push] Validating Pd patches..."
cd "$REPO"
if python3 pd-validator/validate.py pd/*.pd; then
echo "[githook:pre-push] All patches valid"
exit 0
else
echo "[githook:pre-push] Patch validation FAILED — fix before pushing"
exit 1
fi