mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-14 20:39:55 -05:00
Make work in nounset (-u) mode
This commit is contained in:
parent
3fbbc155c7
commit
f06fb60b1f
2 changed files with 4 additions and 4 deletions
|
@ -49,7 +49,7 @@ if [ "$versions" = "--unset" ]; then
|
|||
echo "set -e PYENV_VERSION"
|
||||
;;
|
||||
* )
|
||||
echo 'PYENV_VERSION_OLD="$PYENV_VERSION"'
|
||||
echo 'PYENV_VERSION_OLD="${PYENV_VERSION-}"'
|
||||
echo "unset PYENV_VERSION"
|
||||
;;
|
||||
esac
|
||||
|
@ -110,7 +110,7 @@ if pyenv-prefix "${versions[@]}" >/dev/null; then
|
|||
echo "set -gx PYENV_VERSION \"$version\""
|
||||
;;
|
||||
* )
|
||||
echo 'PYENV_VERSION_OLD="$PYENV_VERSION"'
|
||||
echo 'PYENV_VERSION_OLD="${PYENV_VERSION-}"'
|
||||
echo "export PYENV_VERSION=\"${version}\""
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -47,7 +47,7 @@ load test_helper
|
|||
PYENV_SHELL=bash run pyenv-sh-shell --unset
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
PYENV_VERSION_OLD="\$PYENV_VERSION"
|
||||
PYENV_VERSION_OLD="\${PYENV_VERSION-}"
|
||||
unset PYENV_VERSION
|
||||
OUT
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ SH
|
|||
PYENV_SHELL=bash run pyenv-sh-shell 1.2.3
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
PYENV_VERSION_OLD="\$PYENV_VERSION"
|
||||
PYENV_VERSION_OLD="\${PYENV_VERSION-}"
|
||||
export PYENV_VERSION="1.2.3"
|
||||
OUT
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue