Merge pull request #64 from wwwjfy/master

fix wrong output in test in fish, refs 240a1de
This commit is contained in:
Yamashita, Yuu
2015-01-06 14:05:52 +09:00
2 changed files with 6 additions and 4 deletions

View File

@@ -75,13 +75,14 @@ case "$shell" in
fish )
cat <<EOS
function _pyenv_virtualenv_hook --on-event fish_prompt;
set -l PYENV_PREFIX (pyenv prefix 2>/dev/null; or true)
if [ -n "\$PYENV_ACTIVATE" ]
if [ "(pyenv version-name 2>/dev/null; or true)" = "system" ]
pyenv deactivate --no-error --verbose
set -e PYENV_DEACTIVATE
return 0
end
if [ "\$PYENV_ACTIVATE" != "(pyenv prefix 2>/dev/null; or true)" ]
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
@@ -90,7 +91,7 @@ function _pyenv_virtualenv_hook --on-event fish_prompt;
end
end
else
if [ -z "\$VIRTUAL_ENV" ]; and [ "\$PYENV_DEACTIVATE" != "(pyenv prefix 2>/dev/null; or true)" ]
if [ -z "\$VIRTUAL_ENV" ]; and [ "\$PYENV_DEACTIVATE" != "\$PYENV_PREFIX" ]
pyenv activate --no-error --verbose
end
end

View File

@@ -63,13 +63,14 @@ EOS
assert_output <<EOS
setenv PYENV_VIRTUALENV_INIT 1;
function _pyenv_virtualenv_hook --on-event fish_prompt;
set -l PYENV_PREFIX (pyenv prefix 2>/dev/null; or true)
if [ -n "\$PYENV_ACTIVATE" ]
if [ "(pyenv version-name 2>/dev/null; or true)" = "system" ]
pyenv deactivate --no-error --verbose
set -e PYENV_DEACTIVATE
return 0
end
if [ "\$PYENV_ACTIVATE" != "(pyenv prefix 2>/dev/null; or true)" ]
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
@@ -78,7 +79,7 @@ function _pyenv_virtualenv_hook --on-event fish_prompt;
end
end
else
if [ -z "\$VIRTUAL_ENV" ]; and [ "\$PYENV_DEACTIVATE" != "(pyenv prefix 2>/dev/null; or true)" ]
if [ -z "\$VIRTUAL_ENV" ]; and [ "\$PYENV_DEACTIVATE" != "\$PYENV_PREFIX" ]
pyenv activate --no-error --verbose
end
end