Skip to content

Instantly share code, notes, and snippets.

View danielRomero's full-sized avatar

Daniel Romero danielRomero

View GitHub Profile
@Lycisca
Lycisca / pre-commit
Created July 12, 2017 09:50
Git pre-commit hook to detect some words like binding.pry, debugger...
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='console.log|debugger|binding.pry'
# CHECK
if test $(git diff --cached | grep -E $consoleregexp | wc -l) != 0
then