Created
August 1, 2014 17:28
-
-
Save brianng/cbd9372ddd6fbb70ce20 to your computer and use it in GitHub Desktop.
Simple git pre-commit hook to detect console.log statements
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
#!/bin/sh | |
git diff --cached | grep --quiet "^+.*console\.log" | |
RETVAL=$? | |
if [ $RETVAL -eq 0 ]; then | |
echo "Error: detected console.log statement" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment