Skip to content

Instantly share code, notes, and snippets.

View noappleonhead's full-sized avatar
😺

noappleonhead noappleonhead

😺
View GitHub Profile
@guilherme
guilherme / gist:9604324
Last active May 5, 2024 03:17
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='console.log'
# CHECK
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0
then