blob: b83f1e98dfeda41f6726b667c7a257e71a6f45b7 [file] [log] [blame] [raw]
#!/bin/bash
against='HEAD'
printf "\033[0;32mRunning tests...\033[0m\n"
FORBIDDEN='console.log'
FILES_PATTERN='\.(js)(\..+)?$'
OUT=0
git diff --cached --name-only | \
grep -E $FILES_PATTERN | \
GREP_COLOR='4;5;37;41' xargs grep --color --with-filename -n $FORBIDDEN && printf "Please unstage console.log before commiting\n\033[0;31mAborting commit\033[0m\n" && exit 1
make check
if [ $? -ne 0 ]
then
printf "\033[0;31mAborting commit\033[0m\n"
exit 1
fi