Skip to content

Instantly share code, notes, and snippets.

@ravishrivastava
Created September 16, 2017 08:45
Show Gist options
  • Save ravishrivastava/9ac994c7922a5c353346cd54d4ae67c1 to your computer and use it in GitHub Desktop.
Save ravishrivastava/9ac994c7922a5c353346cd54d4ae67c1 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Check commit for debugger, binding.pry or byebug
if test "$(git diff --cached | grep '\+.*debugger')"
then
echo "Error: Attempt to commit a debugger line"
echo "To skip this check, add the --no-verify option"
exit 1
fi
if test "$(git diff --cached | grep '\+.*binding\.pry')"
then
echo "Error: Attempt to commit a binding.pry line"
echo "To skip this check, add the --no-verify option"
exit 1
fi
if test "$(git diff --cached | grep '\+.*byebug')"
then
echo "Error: Attempt to commit a byebug line"
echo "To skip this check, add the --no-verify option"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment