mirror of
https://github.com/rbenv/rbenv.git
synced 2025-01-01 14:45:03 +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 "set -e RBENV_VERSION"
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
echo 'RBENV_VERSION_OLD="$RBENV_VERSION"'
|
echo 'RBENV_VERSION_OLD="${RBENV_VERSION-}"'
|
||||||
echo "unset RBENV_VERSION"
|
echo "unset RBENV_VERSION"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@ -107,7 +107,7 @@ if rbenv-prefix "$version" >/dev/null; then
|
||||||
echo "set -gx RBENV_VERSION \"$version\""
|
echo "set -gx RBENV_VERSION \"$version\""
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
echo 'RBENV_VERSION_OLD="$RBENV_VERSION"'
|
echo 'RBENV_VERSION_OLD="${RBENV_VERSION-}"'
|
||||||
echo "export RBENV_VERSION=\"$version\""
|
echo "export RBENV_VERSION=\"$version\""
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
|
@ -47,7 +47,7 @@ load test_helper
|
||||||
RBENV_SHELL=bash run rbenv-sh-shell --unset
|
RBENV_SHELL=bash run rbenv-sh-shell --unset
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<OUT
|
assert_output <<OUT
|
||||||
RBENV_VERSION_OLD="\$RBENV_VERSION"
|
RBENV_VERSION_OLD="\${RBENV_VERSION-}"
|
||||||
unset RBENV_VERSION
|
unset RBENV_VERSION
|
||||||
OUT
|
OUT
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ SH
|
||||||
RBENV_SHELL=bash run rbenv-sh-shell 1.2.3
|
RBENV_SHELL=bash run rbenv-sh-shell 1.2.3
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<OUT
|
assert_output <<OUT
|
||||||
RBENV_VERSION_OLD="\$RBENV_VERSION"
|
RBENV_VERSION_OLD="\${RBENV_VERSION-}"
|
||||||
export RBENV_VERSION="1.2.3"
|
export RBENV_VERSION="1.2.3"
|
||||||
OUT
|
OUT
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue