Skip to content

Instantly share code, notes, and snippets.

@dmitrinesterenko
Created September 25, 2014 14:53
Show Gist options
  • Save dmitrinesterenko/40ccbae358d7eec07a5e to your computer and use it in GitHub Desktop.
Save dmitrinesterenko/40ccbae358d7eec07a5e to your computer and use it in GitHub Desktop.
Precomit hook to check if there's a binding.pry left somewhere in your code
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# To enable this hook, rename this file to "pre-commit".
grep -r --include "*.rb" pry .
if [ $? == 0 ]; then
echo "You have a binding.pry"
exit 1
else
echo "not matched"
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment