autopush - Add pre-commit hook to enforce structural validation before commit - Add post-commit hook for resilient Gitea auto-push and offline tolerance - Add scripts/install-hooks.sh to configure core.hooksPath
16 lines
417 B
Bash
Executable File
16 lines
417 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -u
|
|
|
|
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
cd "$REPO_ROOT"
|
|
|
|
echo "🔍 [pre-commit] Validating Brain structure..."
|
|
|
|
if python3 scripts/validate-brain.py; then
|
|
echo "✅ [pre-commit] Brain structure valid."
|
|
else
|
|
echo "❌ [pre-commit] Brain validation failed. Commit aborted."
|
|
echo "💡 [pre-commit] Fix structural issues or move uncurated drafts into inbox/."
|
|
exit 1
|
|
fi
|