Skip to content

Instantly share code, notes, and snippets.

@slobber
slobber / move_virtualenv.sh
Created October 12, 2017 02:46
move_virtualenv
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