make shell return an error code in case of failure

Fixes #274
This commit is contained in:
Mislav Marohnić 2012-12-13 02:58:41 +01:00
parent e548877ead
commit 1f7722088d

View file

@ -23,10 +23,13 @@ fi
if [ "$version" = "--unset" ]; then
echo "unset RBENV_VERSION"
exit 1
exit
fi
# Make sure the specified version is installed.
rbenv-prefix "$version" >/dev/null
echo "export RBENV_VERSION=\"${version}\""
if rbenv-prefix "$version" >/dev/null; then
echo "export RBENV_VERSION=\"${version}\""
else
echo "return 1"
exit 1
fi