Created
November 30, 2012 01:32
-
-
Save barkerja/4173161 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 | |
files=`git diff --cached --name-status | awk '{print $2}'` | |
count_javascript=`grep -iR 'console\.log' $files | wc -l | awk '{print $1}'` | |
count_ruby=`grep -R 'logger\.debug' $files | wc -l | awk '{print $1}'` | |
if [[ "$count_javascript" -ge 1 ]]; then | |
echo "Remove any config.log() statements left in javascript sources" | |
echo "" | |
echo $count_javascript " javascript file(s) to fix:" | |
echo "**********" | |
grep -iR 'console\.log' $files | awk -F ":" '{print $1}' | |
echo "**********" | |
exit 1 | |
fi | |
if [[ "$count_ruby" -ge 1 ]]; then | |
echo "Remove any logger.debug statements left in ruby sources." | |
echo "" | |
echo $count_ruby " ruby file(s) to fix:" | |
echo "**********" | |
grep -iR 'logger\.debug' $files | awk -F ":" '{print $1}' | |
echo "**********" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment