summaryrefslogtreecommitdiff
path: root/pre-commit.sh
blob: 593019404035b4707f07ba918c22dcdbb7074ecc (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/bash
# Check with Nu validator (https://github.com/validator/validator) if installed
which vnu >/dev/null && vnu site/*.html || exit 1
for file in site/*.html; do
	# /dev/null is to force file names to be printed (grep -H is a GNU extension)
	if grep -n '\s$' /dev/null $file; then
		echo "$file has trailing white space."
		exit 1
	fi
done