Skip to content

Instantly share code, notes, and snippets.

@jegtnes
Created March 9, 2016 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jegtnes/c456ba31148b17a3cec6 to your computer and use it in GitHub Desktop.
Save jegtnes/c456ba31148b17a3cec6 to your computer and use it in GitHub Desktop.
#!/bin/bash
mocha_skip_found=`git grep -e ".only" --or -e ".skip" HEAD`
if [ "$mocha_skip_found" ]
then
commit=`git log --pretty=format:'%Cred%h%Creset %s' -G "(.only|.skip)" | head -n1`
echo "Found Mocha test suite skip. This change was last introduced in:"
echo $commit
echo "Not pushing. (override with the --no-verify flag)"
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment