diff --git a/bin/pyenv-sh-activate b/bin/pyenv-sh-activate index 90e0877..eae5707 100755 --- a/bin/pyenv-sh-activate +++ b/bin/pyenv-sh-activate @@ -14,7 +14,7 @@ set -e [ -n "$PYENV_DEBUG" ] && set -x -unset NOERROR +unset QUIET unset VERBOSE while [ $# -gt 0 ]; do @@ -24,8 +24,8 @@ while [ $# -gt 0 ]; do echo --unset exec pyenv-virtualenvs --bare ;; - "--no-error" ) - NOERROR=1 + "--no-error" | "--quiet" ) + QUIET=1 ;; "--unset" ) echo "pyenv deactivate" @@ -57,14 +57,14 @@ if [ -z "${PYENV_VIRTUALENV_INIT}" ]; then fi if [ "${#versions[@]}" -gt 1 ]; then - [ -n "$NOERROR" ] || echo "pyenv-virtualenv: cannot activate multiple versions at once: ${versions[@]}" 1>&2 + [ -n "$QUIET" ] || echo "pyenv-virtualenv: cannot activate multiple versions at once: ${versions[@]}" 1>&2 echo "false" exit 1 fi if pyenv-prefix "${versions}" 1>/dev/null 2>&1; then if ! pyenv-virtualenv-prefix "${versions}" 1>/dev/null 2>&1; then - [ -n "$NOERROR" ] || echo "pyenv-virtualenv: version \`${versions}' is not a virtualenv" 1>&2 + [ -n "$QUIET" ] || echo "pyenv-virtualenv: version \`${versions}' is not a virtualenv" 1>&2 echo "false" exit 1 fi @@ -72,7 +72,7 @@ else version="$(pyenv-version-name)" versions="${version%/envs/*}/envs/${versions}" if ! pyenv-virtualenv-prefix "${versions}" 1>/dev/null 2>&1; then - [ -n "$NOERROR" ] || echo "pyenv-virtualenv: version \`${versions}' is not an environment of anaconda/miniconda" 1>&2 + [ -n "$QUIET" ] || echo "pyenv-virtualenv: version \`${versions}' is not an environment of anaconda/miniconda" 1>&2 echo "false" exit 1 fi diff --git a/bin/pyenv-sh-deactivate b/bin/pyenv-sh-deactivate index e9270d2..ca77e25 100755 --- a/bin/pyenv-sh-deactivate +++ b/bin/pyenv-sh-deactivate @@ -9,13 +9,13 @@ set -e [ -n "$PYENV_DEBUG" ] && set -x -unset NOERROR +unset QUIET unset VERBOSE while [ $# -gt 0 ]; do case "$1" in - "--no-error" ) - NOERROR=1 + "--no-error" | "--quiet") + QUIET=1 ;; "--verbose" ) VERBOSE=1 @@ -31,7 +31,7 @@ shell="$(basename "${PYENV_SHELL:-$SHELL}")" prefix="${PYENV_ACTIVATE:-${VIRTUAL_ENV}}" if [ -z "${VIRTUAL_ENV}" ]; then - [ -n "$NOERROR" ] || echo "pyenv-virtualenv: no virtualenv has been activated." 1>&2 + [ -n "$QUIET" ] || echo "pyenv-virtualenv: no virtualenv has been activated." 1>&2 echo "false" exit 1 fi diff --git a/bin/pyenv-virtualenv-init b/bin/pyenv-virtualenv-init index c7b3d7e..bfd03ff 100755 --- a/bin/pyenv-virtualenv-init +++ b/bin/pyenv-virtualenv-init @@ -106,21 +106,21 @@ function _pyenv_virtualenv_hook --on-event fish_prompt; set -l ret \$status if [ -n "\$PYENV_ACTIVATE" ] if [ (pyenv version-name 2>/dev/null; or true) = "system" ] - pyenv deactivate --no-error + pyenv deactivate --quiet set -e PYENV_DEACTIVATE return \$ret end if [ "\$PYENV_ACTIVATE" != "\$PYENV_PREFIX" ] - if pyenv deactivate --no-error + if pyenv deactivate --quiet set -e PYENV_DEACTIVATE - pyenv activate --no-error; or set -e PYENV_DEACTIVATE + pyenv activate --quiet; or set -e PYENV_DEACTIVATE else - pyenv activate --no-error + pyenv activate --quiet end end else if [ -z "\$VIRTUAL_ENV" ]; and [ "\$PYENV_DEACTIVATE" != "\$PYENV_PREFIX" ] - pyenv activate --no-error; or true + pyenv activate --quiet; or true end end return \$ret @@ -144,21 +144,21 @@ if [[ "$shell" != "fish" ]]; then local ret=\$? if [ -n "\$PYENV_ACTIVATE" ]; then if [ "\$(pyenv version-name 2>/dev/null || true)" = "system" ]; then - eval "\$(pyenv sh-deactivate --no-error)" + eval "\$(pyenv sh-deactivate --quiet)" unset PYENV_DEACTIVATE return \$ret fi if [ "\$PYENV_ACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then - if eval "\$(pyenv sh-deactivate --no-error)"; then + if eval "\$(pyenv sh-deactivate --quiet)"; then unset PYENV_DEACTIVATE - eval "\$(pyenv sh-activate --no-error)" || unset PYENV_DEACTIVATE + eval "\$(pyenv sh-activate --quiet)" || unset PYENV_DEACTIVATE else - eval "\$(pyenv sh-activate --no-error)" + eval "\$(pyenv sh-activate --quiet)" fi fi else if [ -z "\$VIRTUAL_ENV" ] && [ "\$PYENV_DEACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then - eval "\$(pyenv sh-activate --no-error)" || true + eval "\$(pyenv sh-activate --quiet)" || true fi fi return \$ret