Should not persist PYENV_DEACTIVATE after automatic deactivation (#47, #48)

This commit is contained in:
Yamashita Yuu
2014-10-12 21:34:18 +09:00
parent 79bfc9d362
commit d6671249b7

View File

@@ -78,10 +78,12 @@ function _pyenv_virtualenv_hook --on-event fish_prompt;
if [ -n "\$PYENV_ACTIVATE" ]
if [ (pyenv version-name) = "system" ]
pyenv deactivate --no-error --verbose
set -e PYENV_DEACTIVATE
return 0
end
if [ "\$PYENV_ACTIVATE" != (pyenv prefix) ]
if pyenv deactivate --no-error --verbose
set -e PYENV_DEACTIVATE
pyenv activate --no-error --verbose; or set -e PYENV_DEACTIVATE
else
pyenv activate --no-error --verbose
@@ -117,6 +119,7 @@ if [[ "$shell" != "fish" ]]; then
fi
if [ "\$PYENV_ACTIVATE" != "\$(pyenv prefix)" ]; then
if pyenv deactivate --no-error --verbose; then
unset PYENV_DEACTIVATE
pyenv activate --no-error --verbose || unset PYENV_DEACTIVATE
else
pyenv activate --no-error --verbose