Last active
August 29, 2015 14:23
-
-
Save alediaferia/60a2b492b90372674d25 to your computer and use it in GitHub Desktop.
Prevent committing `iit` Protractor (https://github.com/angular/protractor) test suites
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/bash | |
# checking if unadvertedly we have left iit here and | |
# there in protractor test files | |
if git-rev-parse --verify HEAD >/dev/null 2>&1; then | |
against=HEAD | |
else | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
fi | |
for i in `git diff-index --name-only $against --` ; do | |
suffix=${i##*.} | |
if [ "js" -eq "$suffix" ] && [ "grep -E \"^\s*(x|i)it\(\'\" $i" ]; then | |
echo $i " still contains 'iit' or 'xit' directives. Remove them before committing" | |
exit 1 | |
fi | |
done | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.git/hooks/
and name itpre-commit
chmod +x .git/hooks/pre-commit