Skip to content

Instantly share code, notes, and snippets.

@Chavao
Created May 15, 2015 17:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Chavao/bfdfcb5d9e34ea8ede25 to your computer and use it in GitHub Desktop.
Save Chavao/bfdfcb5d9e34ea8ede25 to your computer and use it in GitHub Desktop.
Pre-commit para evitar esquecer "debugger;" no código!
#!/bin/sh
if git rev-parse --verify HEAD >/dev/null 2>&1; then
against=HEAD
else
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
for FILE in `git diff-index --name-status $against | cut -c3-` ; do
# Check if the file contains 'debugger'
if [ "grep 'debugger' $FILE" ]
then
RED='\033[0;31m'
NC='\033[0m' # No Color
printf "====== ${RED}ATENÇÃO${NC} ======\n"
printf "Debugger esquecido em: ${RED}$FILE! ${NC} \n"
exit 1
fi
done
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment