mirror of
https://github.com/rbenv/rbenv.git
synced 2024-12-29 13:15:42 +01:00
Make work in set -u (nounset) mode
This commit is contained in:
parent
c2cfbd1e8b
commit
a5a1c4d50d
2 changed files with 4 additions and 4 deletions
|
@ -49,7 +49,7 @@ if [ "$version" = "--unset" ]; then
|
|||
echo "set -e RBENV_VERSION"
|
||||
;;
|
||||
* )
|
||||
echo 'RBENV_VERSION_OLD="$RBENV_VERSION"'
|
||||
echo 'RBENV_VERSION_OLD="${RBENV_VERSION-}"'
|
||||
echo "unset RBENV_VERSION"
|
||||
;;
|
||||
esac
|
||||
|
@ -107,7 +107,7 @@ if rbenv-prefix "$version" >/dev/null; then
|
|||
echo "set -gx RBENV_VERSION \"$version\""
|
||||
;;
|
||||
* )
|
||||
echo 'RBENV_VERSION_OLD="$RBENV_VERSION"'
|
||||
echo 'RBENV_VERSION_OLD="${RBENV_VERSION-}"'
|
||||
echo "export RBENV_VERSION=\"$version\""
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -47,7 +47,7 @@ load test_helper
|
|||
RBENV_SHELL=bash run rbenv-sh-shell --unset
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
RBENV_VERSION_OLD="\$RBENV_VERSION"
|
||||
RBENV_VERSION_OLD="\${RBENV_VERSION-}"
|
||||
unset RBENV_VERSION
|
||||
OUT
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ SH
|
|||
RBENV_SHELL=bash run rbenv-sh-shell 1.2.3
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
RBENV_VERSION_OLD="\$RBENV_VERSION"
|
||||
RBENV_VERSION_OLD="\${RBENV_VERSION-}"
|
||||
export RBENV_VERSION="1.2.3"
|
||||
OUT
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue