Files
Mana-Loop/.husky/pre-commit
T
n8n-gitea 2432f807be
Build and Publish Mana Loop Docker Image / build-and-publish (push) Failing after 1m58s
chore: add test runner to pre-commit hook with failure-only output
2026-05-31 01:42:34 +02:00

35 lines
835 B
Bash
Executable File

#!/bin/sh
echo "🔍 Running pre-commit checks..."
# Get staged files (added, copied, modified)
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
if [ -n "$STAGED_FILES" ]; then
echo "📏 Checking file sizes..."
node .husky/scripts/check-file-size.js $STAGED_FILES
if [ $? -ne 0 ]; then
exit 1
fi
fi
# Run tests — only failing tests are printed to keep output focused
echo "🧪 Running tests..."
bash .husky/scripts/run-tests.sh
if [ $? -ne 0 ]; then
exit 1
fi
# Generate project structure
echo "🗺️ Updating project structure..."
node .husky/scripts/generate-project-tree.js
node .husky/scripts/generate-dependency-graph.js
if [ $? -ne 0 ]; then
exit 1
fi
# Auto-add the generated project structure to the commit
git add docs/project-structure.txt
echo "✅ All pre-commit checks passed!"