Skip to content

Instantly share code, notes, and snippets.

@jeekl
Created October 19, 2012 09:12
Show Gist options
  • Save jeekl/3917098 to your computer and use it in GitHub Desktop.
Save jeekl/3917098 to your computer and use it in GitHub Desktop.
pre-commit hook, checking json syntax in groups/users for chef-repo
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