Created
October 19, 2012 09:12
-
-
Save jeekl/3917098 to your computer and use it in GitHub Desktop.
pre-commit hook, checking json syntax in groups/users for chef-repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git stash -q --keep-index | |
for file in data_bags/user/* data_bags/group/* ; do | |
python -mjson.tool $file 1> /dev/null; | |
RESULT=$? | |
[ $RESULT -ne 0 ] && echo "JSON syntax faulty: $file" && exit 1 | |
done | |
git stash pop -q | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment