Created
July 6, 2017 03:28
-
-
Save fathergoose/9096b701fc474cd7e83f7c0dba627b9e to your computer and use it in GitHub Desktop.
Check for debugger statements before commiting your code.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Check for debugger statements before commiting your code. | |
# | |
# Nodejs uses 'debugger' as a keyword statement to trigger a | |
# breakpoint. There's literally no reason to commit such a thing | |
echo "Running debugger check..." | |
RES=`git grep -n 'debugger'` | |
if [[ -n "$RES" ]]; then | |
echo "\nDebugging functions were found in your at" | |
echo "\n$RES" | |
echo "Changes not committed" | |
exit 1; | |
else | |
echo "\n No 'debugger' statements found.\n"; | |
exit 0; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment