Skip to content

Instantly share code, notes, and snippets.

View mariliacamara's full-sized avatar
🎯
Focusing

Marília Câmara mariliacamara

🎯
Focusing
View GitHub Profile
@guilherme
guilherme / gist:9604324
Last active July 4, 2024 01: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