-
-
Save jlindley/673376 to your computer and use it in GitHub Desktop.
pre-commit hook for git, prevents 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 | |
# Don't allow console.log() statements to be committed. | |
# | |
# Add to .git/hooks/pre-commit | |
# | |
# Note: jquery.js seems to always include 1 reference | |
# in a debugging section, that one can be safely | |
# ignored. 1 reference to console.log is cool | |
count=`grep -iR 'console\.log' public/javascripts/* | wc -l | awk '{print $1}'` | |
if [[ "$count" -ge 2 ]]; then | |
echo " remove any config.log() statements in javascript sources" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you mean console.log()? ;-)