dotfiles/.config/git/hooks/void-packages/pre-commit

16 lines
319 B
Plaintext
Raw Normal View History

2024-04-22 11:00:48 +02:00
#!/bin/bash
# xlint all changed templates
2024-06-26 12:14:43 +02:00
# xgensum all changed templates
2024-04-22 11:00:48 +02:00
EX_ERR=1
FILES=$(git diff --name-only --staged | grep template)
for FILE in ${FILES}; do
stat "${FILE}" &> /dev/null || continue
2024-06-26 12:14:43 +02:00
echo "linting ${FILE}:"
2024-04-22 11:00:48 +02:00
xlint $FILE || exit $EX_ERR
2024-06-26 12:14:43 +02:00
xgensum -i $FILE || exit $EX_ERR
2024-04-22 11:00:48 +02:00
echo "all clear."
done
2024-06-26 12:14:43 +02:00