replaced --no-error by --quiet

This commit is contained in:
Yamashita, Yuu
2015-11-06 17:33:40 +00:00
parent bf7e9ba59a
commit 8731e9bf14
3 changed files with 20 additions and 20 deletions

View File

@@ -14,7 +14,7 @@
set -e set -e
[ -n "$PYENV_DEBUG" ] && set -x [ -n "$PYENV_DEBUG" ] && set -x
unset NOERROR unset QUIET
unset VERBOSE unset VERBOSE
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
@@ -24,8 +24,8 @@ while [ $# -gt 0 ]; do
echo --unset echo --unset
exec pyenv-virtualenvs --bare exec pyenv-virtualenvs --bare
;; ;;
"--no-error" ) "--no-error" | "--quiet" )
NOERROR=1 QUIET=1
;; ;;
"--unset" ) "--unset" )
echo "pyenv deactivate" echo "pyenv deactivate"
@@ -57,14 +57,14 @@ if [ -z "${PYENV_VIRTUALENV_INIT}" ]; then
fi fi
if [ "${#versions[@]}" -gt 1 ]; then 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" echo "false"
exit 1 exit 1
fi fi
if pyenv-prefix "${versions}" 1>/dev/null 2>&1; then if pyenv-prefix "${versions}" 1>/dev/null 2>&1; then
if ! pyenv-virtualenv-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" echo "false"
exit 1 exit 1
fi fi
@@ -72,7 +72,7 @@ else
version="$(pyenv-version-name)" version="$(pyenv-version-name)"
versions="${version%/envs/*}/envs/${versions}" versions="${version%/envs/*}/envs/${versions}"
if ! pyenv-virtualenv-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 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" echo "false"
exit 1 exit 1
fi fi

View File

@@ -9,13 +9,13 @@
set -e set -e
[ -n "$PYENV_DEBUG" ] && set -x [ -n "$PYENV_DEBUG" ] && set -x
unset NOERROR unset QUIET
unset VERBOSE unset VERBOSE
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
case "$1" in case "$1" in
"--no-error" ) "--no-error" | "--quiet")
NOERROR=1 QUIET=1
;; ;;
"--verbose" ) "--verbose" )
VERBOSE=1 VERBOSE=1
@@ -31,7 +31,7 @@ shell="$(basename "${PYENV_SHELL:-$SHELL}")"
prefix="${PYENV_ACTIVATE:-${VIRTUAL_ENV}}" prefix="${PYENV_ACTIVATE:-${VIRTUAL_ENV}}"
if [ -z "${VIRTUAL_ENV}" ]; then 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" echo "false"
exit 1 exit 1
fi fi

View File

@@ -106,21 +106,21 @@ function _pyenv_virtualenv_hook --on-event fish_prompt;
set -l ret \$status set -l ret \$status
if [ -n "\$PYENV_ACTIVATE" ] if [ -n "\$PYENV_ACTIVATE" ]
if [ (pyenv version-name 2>/dev/null; or true) = "system" ] if [ (pyenv version-name 2>/dev/null; or true) = "system" ]
pyenv deactivate --no-error pyenv deactivate --quiet
set -e PYENV_DEACTIVATE set -e PYENV_DEACTIVATE
return \$ret return \$ret
end end
if [ "\$PYENV_ACTIVATE" != "\$PYENV_PREFIX" ] if [ "\$PYENV_ACTIVATE" != "\$PYENV_PREFIX" ]
if pyenv deactivate --no-error if pyenv deactivate --quiet
set -e PYENV_DEACTIVATE set -e PYENV_DEACTIVATE
pyenv activate --no-error; or set -e PYENV_DEACTIVATE pyenv activate --quiet; or set -e PYENV_DEACTIVATE
else else
pyenv activate --no-error pyenv activate --quiet
end end
end end
else else
if [ -z "\$VIRTUAL_ENV" ]; and [ "\$PYENV_DEACTIVATE" != "\$PYENV_PREFIX" ] if [ -z "\$VIRTUAL_ENV" ]; and [ "\$PYENV_DEACTIVATE" != "\$PYENV_PREFIX" ]
pyenv activate --no-error; or true pyenv activate --quiet; or true
end end
end end
return \$ret return \$ret
@@ -144,21 +144,21 @@ if [[ "$shell" != "fish" ]]; then
local ret=\$? local ret=\$?
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
eval "\$(pyenv sh-deactivate --no-error)" eval "\$(pyenv sh-deactivate --quiet)"
unset PYENV_DEACTIVATE unset PYENV_DEACTIVATE
return \$ret return \$ret
fi fi
if [ "\$PYENV_ACTIVATE" != "\$(pyenv prefix 2>/dev/null || true)" ]; then 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 unset PYENV_DEACTIVATE
eval "\$(pyenv sh-activate --no-error)" || unset PYENV_DEACTIVATE eval "\$(pyenv sh-activate --quiet)" || unset PYENV_DEACTIVATE
else else
eval "\$(pyenv sh-activate --no-error)" eval "\$(pyenv sh-activate --quiet)"
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
eval "\$(pyenv sh-activate --no-error)" || true eval "\$(pyenv sh-activate --quiet)" || true
fi fi
fi fi
return \$ret return \$ret