Update pre-commit script

This commit is contained in:
Jan Tuomi
2018-01-25 22:22:37 +02:00
parent f8e68acd4d
commit cf50050eba
2 changed files with 15 additions and 7 deletions
+14 -7
View File
@@ -1,17 +1,24 @@
. "VIRTUALENV_ACTIVATE"
if [ $? -ne 0 ]
then
echo "Failed to source virtualenv. Skipping pre-commit hook."
exit 0;
fi
#!/bin/bash
set -e
PURPLE='\033[0;35m'
NC='\033[0m' # No Color
. "${VIRTUAL_ENV}/bin/activate"
if [ $? -ne 0 ]
then
printf "${PURPLE}Failed to find virtualenv. Skipping pre-commit hook.\n${NC}"
exit 0
fi
set -e
printf "${PURPLE}Running pre-commit tests.${NC}\n"
printf "${PURPLE}npm tests...${NC}\n"
npm test
printf "${PURPLE}pycodestyle tests...${NC}\n"
pycodestyle .
printf "${PURPLE}unit tests...${NC}\n"
python manage.py test --noinput
set +e