void-packages: pre-commit hook

This commit is contained in:
fanyx 2024-06-26 12:14:43 +02:00
parent 040ad03e33
commit 845cdd62c9
1 changed files with 4 additions and 1 deletions

View File

@ -1,12 +1,15 @@
#!/bin/bash
# xlint all changed templates
# xgensum all changed templates
EX_ERR=1
FILES=$(git diff --name-only --staged | grep template)
for FILE in ${FILES}; do
stat "${FILE}" &> /dev/null || continue
echo "xlint ${FILE}:"
echo "linting ${FILE}:"
xlint $FILE || exit $EX_ERR
xgensum -i $FILE || exit $EX_ERR
echo "all clear."
done