Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if [ "$allowjsconsole" != "true" ]; then
- jsfiles=$(git diff --cached --name-only --relative $against | sed -n '/\.js$/p');
- if [ -n "$jsfiles" ] &&
- [ -n "$( git diff --cached -Sconsole. $jsfiles | sed -n 's/console\.\(\w\+\)(.*\?)/&/p')" ];
- then
- echo "Error: Attempt to commit javascript with js console usage."
- echo
- echo "This might upset the master people..."
- echo
- echo "if you don't care about their wishes, you can disable"
- echo "this check by using:"
- echo
- echo " git config hooks.allowjsconsole true"
- echo
- exit 1
- fi
- fi
Add Comment
Please, Sign In to add comment