diff options
-rwxr-xr-x | assets/hooks/pre-commit | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/assets/hooks/pre-commit b/assets/hooks/pre-commit new file mode 100755 index 00000000..b1be0867 --- /dev/null +++ b/assets/hooks/pre-commit @@ -0,0 +1,18 @@ +#!/bin/sh +set -euf +DB="assets.json" +TMP=`mktemp` + +echo "** checking $DB for sanity" +cat $DB | python -m json.tool > $TMP +RET=$? +if [ "$RET" = "0" ]; +then + echo "** Check succeeded" + git add $DB + mv $TMP $DB +else + echo "!! database insane!" + cat $TMP +fi +exit $RET |