From 21119c26a137880690335f2d4e758713b58244d0 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 1 Dec 2011 22:21:35 +0100 Subject: //assets/hooks pre-commit: initial commit --- assets/hooks/pre-commit | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 assets/hooks/pre-commit (limited to 'assets/hooks') 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 -- cgit v1.2.3