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

16 lines
319 B
Bash
Executable File

#!/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 "linting ${FILE}:"
xlint $FILE || exit $EX_ERR
xgensum -i $FILE || exit $EX_ERR
echo "all clear."
done