#!/bin/sh
# CTR Reload Edition - pre-commit: everything in this repository is English.
#
# Checks the staged files and their names, renames included, with
# tools/lang_check.py (German words, umlauts, person names, internal
# references, local paths, day.month.year dates).
# Install once per clone:  git config core.hooksPath tools/git-hooks

root=$(git rev-parse --show-toplevel) || exit 1
py=python
command -v "$py" >/dev/null 2>&1 || py=python3
"$py" "$root/tools/lang_check.py" --staged || {
	echo "pre-commit: COMMIT REFUSED - see the findings above." >&2
	exit 1
}
