Created
December 2, 2015 12:21
-
-
Save FuYaoDe/de05cfe2481cd84412ef to your computer and use it in GitHub Desktop.
Run Check .only before commit, prevent mocha test prevent .
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 | |
# | |
# Run Check Only before commit. | |
RED='\033[0;31m' | |
if [ "$(git diff --cached | grep "+" | grep ".only")" != "" ]; then | |
echo "" | |
echo "${RED}COMMIT FAILED:" | |
echo "${RED}Some spec files have .only. Please remove only and try committing again." | |
exit 1 | |
else | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment