diff options
author | makefu <github@syntax-fehler.de> | 2011-12-01 22:21:35 +0100 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2011-12-01 22:21:35 +0100 |
commit | 21119c26a137880690335f2d4e758713b58244d0 (patch) | |
tree | 3c80551f5c62bbc9619b5bbdd4254ff4f618f956 | |
parent | afcf1b590f36b00b60efc43aa132c1cf01c2ac0e (diff) |
//assets/hooks pre-commit: initial commit
-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 |