Created
October 12, 2017 02:46
-
-
Save slobber/36735dfd8e89a870b7542f3d47fc77bc to your computer and use it in GitHub Desktop.
move_virtualenv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VIRTUALENV_NAME=py2.ipy5 | |
PYENV=`grep -oP '(?<=VIRTUAL_ENV=")(.*)(?=")' ${VIRTUALENV_NAME}/bin/activate` | |
PWD=`pwd` | |
if [ $PYENV != "${PWD}/${VIRTUALENV_NAME}" ]; then | |
echo "First run, prepare environment..." | |
source "${PWD}/${VIRTUALENV_NAME}/bin/activate" | |
pip freeze > requirements.txt | |
deactivate | |
rm -rf "${PWD}/${VIRTUALENV_NAME}" | |
virtualenv "${PWD}/${VIRTUALENV_NAME}" | |
source "${PWD}/${VIRTUALENV_NAME}/bin/activate" | |
pip install -r requirements.txt | |
rm -f requirements.txt | |
deactivate | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment