Created
December 16, 2010 22:15
-
-
Save semanticart/744108 to your computer and use it in GitHub Desktop.
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 | |
# ack the diff with a regexp to | |
# prevent you from adding lines (the \+ at the beginning indicates an added line in the diff) | |
# that introduce console.log | |
# and are not commented out (the \s* before console.log) | |
has_console_log=$(git diff --cached | ack '^\+\s*console\.log\(.*\)') | |
if [ "$has_console_log" != "" ] | |
then | |
echo "ERROR: You have console.log in your commit. Remove them." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment