deactivate a venv before creating a new one, this avoid symlinks of python executable from a venv to another to another...

This commit is contained in:
Julien Palard 2017-10-03 11:18:29 +02:00
parent 828f6eef39
commit f9d0627fa1
1 changed files with 1 additions and 0 deletions

View File

@ -137,6 +137,7 @@ workon()
else
local VENV_NAME="$1"
fi
deactivate >/dev/null 2>/dev/null
[ -d "$VENVS/$VENV_NAME" ] || mkdir -p "$VENVS/$VENV_NAME"
[ -f "$VENVS/$VENV_NAME/bin/activate" ] || python3 -m venv "$VENVS/$VENV_NAME"
. "$VENVS/$VENV_NAME/bin/activate"