Enforce absolute RBENV_DIR

This prevents CDPATH from becoming an issue.

Closes #866.
This commit is contained in:
Tim Pope 2017-04-05 16:29:18 -04:00
parent 4f8925abe7
commit 1f1e291385

View file

@ -60,6 +60,7 @@ export RBENV_ROOT
if [ -z "${RBENV_DIR}" ]; then if [ -z "${RBENV_DIR}" ]; then
RBENV_DIR="$PWD" RBENV_DIR="$PWD"
else else
[[ $RBENV_DIR == /* ]] || RBENV_DIR=$PWD/$RBENV_DIR
cd "$RBENV_DIR" 2>/dev/null || abort "cannot change working directory to \`$RBENV_DIR'" cd "$RBENV_DIR" 2>/dev/null || abort "cannot change working directory to \`$RBENV_DIR'"
RBENV_DIR="$PWD" RBENV_DIR="$PWD"
cd "$OLDPWD" cd "$OLDPWD"