update-python-env: fix empty .python-version situation
Even if .python-version is empty, virtualenv with desired name could be created somewhere in the system. So we need to delete it in any case. If there is no such virtualenv, we are ignoring errors.
This commit is contained in:
parent
a6ca99d58d
commit
3023edbfe3
@ -23,13 +23,11 @@ if [ $res -eq 1 ]; then
|
||||
fi
|
||||
|
||||
CUR_VENV=$(cat .python-version)
|
||||
if [ -n "$CUR_VENV" ]; then
|
||||
echo "[*] Removing current virtualenv ($CUR_VENV)"
|
||||
pyenv virtualenv-delete -f $CUR_VENV || exit 1
|
||||
echo "[*] Removing current virtualenv ($CUR_VENV)"
|
||||
pyenv virtualenv-delete -f $CUR_VENV || true
|
||||
|
||||
echo "[*] Removing virtualenv named as project ($PROJECT)"
|
||||
pyenv virtualenv-delete -f $PROJECT || exit 1
|
||||
fi
|
||||
echo "[*] Removing virtualenv named as project ($PROJECT)"
|
||||
pyenv virtualenv-delete -f $PROJECT || true
|
||||
|
||||
NEW_VENV=$PY_VER/envs/$PROJECT
|
||||
echo "[*] Creating new virtualenv ($NEW_VENV)"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user