Skip to content

Instantly share code, notes, and snippets.

@syguer
Created April 13, 2017 07:07
Show Gist options
  • Select an option

  • Save syguer/7e646827e43c5463551688dace18197d to your computer and use it in GitHub Desktop.

Select an option

Save syguer/7e646827e43c5463551688dace18197d to your computer and use it in GitHub Desktop.
Avoid to commit development code
#!/bin/sh
RESULT=$(ag binding.pry app/* lib/* | wc -l | sed -e 's/ //g')
if test $RESULT -gt 0; then
echo "binding.pry exists! Aborting."
exit 1
fi
RESULT=$(ag console.log app/* lib/* | wc -l | sed -e 's/ //g')
if test $RESULT -gt 0; then
echo "console.log exists! Aborting."
exit 1
fi
RESULT=$(ag "focus: true" spec/* | grep -v rails_helper | wc -l | sed -e 's/ //g')
if test $RESULT -gt 0; then
echo "focus: true exists! Aborting."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment