Guest User

Untitled

a guest
May 26th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. if [ "$allowjsconsole" != "true" ]; then
  2. jsfiles=$(git diff --cached --name-only --relative $against | sed -n '/\.js$/p');
  3. if [ -n "$jsfiles" ] &&
  4. [ -n "$( git diff --cached -Sconsole. $jsfiles | sed -n 's/console\.\(\w\+\)(.*\?)/&/p')" ];
  5. then
  6. echo "Error: Attempt to commit javascript with js console usage."
  7. echo
  8. echo "This might upset the master people..."
  9. echo
  10. echo "if you don't care about their wishes, you can disable"
  11. echo "this check by using:"
  12. echo
  13. echo " git config hooks.allowjsconsole true"
  14. echo
  15. exit 1
  16. fi
  17. fi
Add Comment
Please, Sign In to add comment