Fix Error: too many arguments. on deactivating anaconda env

This commit is contained in:
Yamashita, Yuu
2015-07-19 01:00:24 +09:00
parent e1523811fb
commit be6701e7b6
4 changed files with 17 additions and 17 deletions

View File

@@ -122,7 +122,7 @@ if [ -n "${conda_env}" ]; then
cat <<EOS cat <<EOS
unset PYENV_DEACTIVATE; unset PYENV_DEACTIVATE;
export PYENV_ACTIVATE="${prefix}"; export PYENV_ACTIVATE="${prefix}";
. "${prefix%/envs/*}/bin/activate" "${versions##*/}" . "${prefix%/envs/*}/bin/activate" "${versions##*/}";
EOS EOS
else else
# virtualenv/pyvenv # virtualenv/pyvenv

View File

@@ -87,7 +87,7 @@ if [ -n "${conda_env}" ]; then
cat <<EOS cat <<EOS
export PYENV_DEACTIVATE="$prefix"; export PYENV_DEACTIVATE="$prefix";
unset PYENV_ACTIVATE; unset PYENV_ACTIVATE;
. "${prefix%/envs/*}/bin/deactivate" "${prefix##*/envs/}"; . "${prefix%/envs/*}/bin/deactivate";
else else
EOS EOS
else else

View File

@@ -115,21 +115,21 @@ if [[ "$shell" != "fish" ]]; then
cat <<EOS cat <<EOS
if [ -n "\$PYENV_ACTIVATE" ]; then if [ -n "\$PYENV_ACTIVATE" ]; then
if [ "\$(pyenv version-name 2>/dev/null || true)" = "system" ]; then if [ "\$(pyenv version-name 2>/dev/null || true)" = "system" ]; then
pyenv deactivate --no-error --verbose eval "\$(pyenv sh-deactivate --no-error --verbose)"
unset PYENV_DEACTIVATE unset PYENV_DEACTIVATE
return 0 return 0
fi fi
if [ "\$PYENV_ACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then if [ "\$PYENV_ACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then
if pyenv deactivate --no-error --verbose; then if eval "\$(pyenv sh-deactivate --no-error --verbose)"; then
unset PYENV_DEACTIVATE unset PYENV_DEACTIVATE
pyenv activate --no-error --verbose || unset PYENV_DEACTIVATE eval "\$(pyenv sh-activate --no-error --verbose)" || unset PYENV_DEACTIVATE
else else
pyenv activate --no-error --verbose eval "\$(pyenv sh-activate --no-error --verbose)"
fi fi
fi fi
else else
if [ -z "\$VIRTUAL_ENV" ] && [ "\$PYENV_DEACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then if [ -z "\$VIRTUAL_ENV" ] && [ "\$PYENV_DEACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then
pyenv activate --no-error --verbose || true eval "\$(pyenv sh-activate --no-error --verbose)" || true
fi fi
fi fi
}; };

View File

@@ -51,21 +51,21 @@ export PYENV_VIRTUALENV_INIT=1;
_pyenv_virtualenv_hook() { _pyenv_virtualenv_hook() {
if [ -n "\$PYENV_ACTIVATE" ]; then if [ -n "\$PYENV_ACTIVATE" ]; then
if [ "\$(pyenv version-name 2>/dev/null || true)" = "system" ]; then if [ "\$(pyenv version-name 2>/dev/null || true)" = "system" ]; then
pyenv deactivate --no-error --verbose eval "\$(pyenv sh-deactivate --no-error --verbose)"
unset PYENV_DEACTIVATE unset PYENV_DEACTIVATE
return 0 return 0
fi fi
if [ "\$PYENV_ACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then if [ "\$PYENV_ACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then
if pyenv deactivate --no-error --verbose; then if eval "\$(pyenv sh-deactivate --no-error --verbose)"; then
unset PYENV_DEACTIVATE unset PYENV_DEACTIVATE
pyenv activate --no-error --verbose || unset PYENV_DEACTIVATE eval "\$(pyenv sh-activate --no-error --verbose)" || unset PYENV_DEACTIVATE
else else
pyenv activate --no-error --verbose eval "\$(pyenv sh-activate --no-error --verbose)"
fi fi
fi fi
else else
if [ -z "\$VIRTUAL_ENV" ] && [ "\$PYENV_DEACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then if [ -z "\$VIRTUAL_ENV" ] && [ "\$PYENV_DEACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then
pyenv activate --no-error --verbose || true eval "\$(pyenv sh-activate --no-error --verbose)" || true
fi fi
fi fi
}; };
@@ -113,21 +113,21 @@ export PYENV_VIRTUALENV_INIT=1;
_pyenv_virtualenv_hook() { _pyenv_virtualenv_hook() {
if [ -n "\$PYENV_ACTIVATE" ]; then if [ -n "\$PYENV_ACTIVATE" ]; then
if [ "\$(pyenv version-name 2>/dev/null || true)" = "system" ]; then if [ "\$(pyenv version-name 2>/dev/null || true)" = "system" ]; then
pyenv deactivate --no-error --verbose eval "\$(pyenv sh-deactivate --no-error --verbose)"
unset PYENV_DEACTIVATE unset PYENV_DEACTIVATE
return 0 return 0
fi fi
if [ "\$PYENV_ACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then if [ "\$PYENV_ACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then
if pyenv deactivate --no-error --verbose; then if eval "\$(pyenv sh-deactivate --no-error --verbose)"; then
unset PYENV_DEACTIVATE unset PYENV_DEACTIVATE
pyenv activate --no-error --verbose || unset PYENV_DEACTIVATE eval "\$(pyenv sh-activate --no-error --verbose)" || unset PYENV_DEACTIVATE
else else
pyenv activate --no-error --verbose eval "\$(pyenv sh-activate --no-error --verbose)"
fi fi
fi fi
else else
if [ -z "\$VIRTUAL_ENV" ] && [ "\$PYENV_DEACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then if [ -z "\$VIRTUAL_ENV" ] && [ "\$PYENV_DEACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then
pyenv activate --no-error --verbose || true eval "\$(pyenv sh-activate --no-error --verbose)" || true
fi fi
fi fi
}; };