Created
February 4, 2011 14:03
-
-
Save joerixaop/811139 to your computer and use it in GitHub Desktop.
Git post commit hook to remind me not to add 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 | |
# Detects a forgotten console.log statement | |
# Could be made a pre-commit hook forcing the issue, but then adding jQuery.js becomes cumbersome | |
if $(git show HEAD | grep -q '^\+.*console\.log') | |
then | |
RED='\e[1;31m' | |
NC='\e[0m' | |
echo -e "${RED}WARNING:${NC}" | |
echo " You left in a console.log statement in your code, please reconsider commiting this" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment