Created
March 8, 2014 08:36
-
-
Save ftokarev/9427408 to your computer and use it in GitHub Desktop.
Git pre-commit hook for qunit-karma-launch
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
#!/bin/bash | |
# | |
# Check, whether tests contain omodule, otest | |
# | |
TESTDIR='./tests' | |
INTEGRATION="$TESTDIR/integration" | |
UNIT="$TESTDIR/unit" | |
MATCHES=( $(rgrep -El 'omodule|otest' $UNIT $INTEGRATION) ) | |
if [ ! ${#MATCHES[@]} -eq 0 ] | |
then | |
echo "Error: attempt to commit tests containing omodule/otest" | |
echo "" | |
echo "Offending files:" | |
for file in "${MATCHES[@]}" | |
do | |
echo " ${file}" | |
done | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment