if [ ! -d ".virtualenvs" ]; then
  mkdir .virtualenvs
fi
virtualenv .virtualenvs/flask-test-app
. .virtualenvs/flask-test-app/bin/activate
pip install -r requirements.txt
python run.py
if [ ! -d ".virtualenvs" ]; then
  mkdir .virtualenvs
fi
virtualenv .virtualenvs/flask-test-app
.virtualenvs/flask-test-app/bin/pip install -r requirements.txt
.virtualenvs/flask-test-app/bin/python run.py

Add full paths since shell scripts don't work well with virtualenv
Add full paths since shell scripts don't work well with virtualenv