#!/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

