Skip to content

Instantly share code, notes, and snippets.

@dpick
Created September 30, 2011 15:45
Show Gist options
  • Save dpick/1254161 to your computer and use it in GitHub Desktop.
Save dpick/1254161 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Don't allow console.log() or 'and show me the page' statements to be committed.
console=`git diff --cached | grep -i 'console\.log' | wc -l`
showme=`git diff --cached | grep -i 'and show me the page' | wc -l`
echo "$console console.log() statments"
echo "$showme 'and show me the page' statements"
echo ""
if [ $console -gt 0 -o $showme -gt 0 ]; then
echo " please remove the offending statements before committing"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment