. "VIRTUALENV_ACTIVATE"
if [ $? -ne 0 ]
then
    echo "Failed to source virtualenv. Skipping pre-commit hook."
    exit 0;
fi

set -e
PURPLE='\033[0;35m'
NC='\033[0m' # No Color

printf "${PURPLE}Running pre-commit tests.${NC}\n"
npm test
pycodestyle .
python manage.py test --noinput
set +e

printf "${PURPLE}Tests passed.${NC}\n"