Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ndizazzo/7add514dd59243f352049c1278c61091 to your computer and use it in GitHub Desktop.
Save ndizazzo/7add514dd59243f352049c1278c61091 to your computer and use it in GitHub Desktop.
Abort commit if snapshot tests are left on
PROJ_PREFIX='*-ios'
function projroot()
{
while [[ $PWD != '/' && ${PWD##*/} != $PROJ_PREFIX ]]; do cd ..; done
}
projroot
if test $(grep -R "self.recordMode = true" ./*SnapshotTests | wc -c) != 0 ; then
echo "You have left record mode on in this commit!"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment