diff options
Diffstat (limited to 'pre-commit.sh')
-rwxr-xr-x | pre-commit.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pre-commit.sh b/pre-commit.sh new file mode 100755 index 0000000..995cc0a --- /dev/null +++ b/pre-commit.sh @@ -0,0 +1,11 @@ +#!/bin/bash +for file in site/*.html; do + echo "Checking $file..." + # Check with Nu validator (https://github.com/validator/validator) if installed + which vnu >/dev/null && vnu $file || exit 1 + # /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 |