Skip to content

Commit

Permalink
Properly expand RBENV_DIR and ensure it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
sstephenson committed Dec 25, 2011
1 parent b670849 commit 7fbcde8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libexec/rbenv
Expand Up @@ -30,7 +30,12 @@ export RBENV_ROOT
if [ -z "${RBENV_DIR}" ]; then
RBENV_DIR="$(pwd)"
else
RBENV_DIR="$(abs_dirname "$RBENV_DIR")"
cd "$RBENV_DIR" 2>/dev/null || {
echo "rbenv: cannot change working directory to \`$RBENV_DIR'"
exit 1
} >&2
RBENV_DIR="$(pwd)"
cd "$OLDPWD"
fi
export RBENV_DIR

Expand Down

0 comments on commit 7fbcde8

Please sign in to comment.