summaryrefslogtreecommitdiffstats
path: root/assets/hooks
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2011-12-01 22:21:35 +0100
committermakefu <github@syntax-fehler.de>2011-12-01 22:21:35 +0100
commit21119c26a137880690335f2d4e758713b58244d0 (patch)
tree3c80551f5c62bbc9619b5bbdd4254ff4f618f956 /assets/hooks
parentafcf1b590f36b00b60efc43aa132c1cf01c2ac0e (diff)
//assets/hooks pre-commit: initial commit
Diffstat (limited to 'assets/hooks')
-rwxr-xr-xassets/hooks/pre-commit18
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