Last active
May 1, 2019 09:21
-
-
Save edulan/0f0e7510543f8f72c32e to your computer and use it in GitHub Desktop.
Git pre-commit hook for checking Mocha .only declarations
This file contains hidden or 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
#!/usr/bin/env bash | |
PATTERN="describe\.only\|it\.only" | |
MESSAGE="You cannot commit this SHITE" | |
if git diff --name-only --cached | xargs grep -Hn --color=always $PATTERN; then | |
echo "" | |
echo $MESSAGE | |
exit 1 | |
else | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Developer friendly