Skip to content

Instantly share code, notes, and snippets.

@rethab
Created May 27, 2014 12:05
Show Gist options
  • Save rethab/21cc309e4c82fd0f5cb4 to your computer and use it in GitHub Desktop.
Save rethab/21cc309e4c82fd0f5cb4 to your computer and use it in GitHub Desktop.
Commit Hook: make sure no unwanted content gets commited
#!/bin/sh
#
SEARCH_DIRS="application/ library/COP/"
declare -a names=("Zend_Debug" "var_dump" "die(")
for UNWANTED_CONTENT in "${names[@]}"
do
if git grep $UNWANTED_CONTENT $SEARCH_DIRS > /dev/null 2>&1
then
echo "$UNWANTED_CONTENT found"
exit 1
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment