Merge pull request #1786 from scop/nounset

Make work in nounset (-u) mode
This commit is contained in:
Anton Petrov 2021-02-28 22:20:46 +03:00 committed by GitHub
commit ec2d2b970b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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
}