From aa096727adad3a4ae5e18cd01e161f3aeff8ac9c Mon Sep 17 00:00:00 2001 From: Daniele Sluijters Date: Sun, 3 Nov 2013 18:18:10 +0100 Subject: [PATCH] rbenv: Detect $RBENV_ROOT and act accordingly. Same fix as with pyenv, if RBENV_ROOT is set, use that. This also fixes issues for Homebrew users if they followed the caveat to set RBENV_ROOT to use the homebrew created directories. --- plugins/rbenv/rbenv.load | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/plugins/rbenv/rbenv.load b/plugins/rbenv/rbenv.load index e7a5f25..de49047 100644 --- a/plugins/rbenv/rbenv.load +++ b/plugins/rbenv/rbenv.load @@ -1,7 +1,17 @@ -if test -d $HOME/.rbenv/bin - set PATH $HOME/.rbenv/bin $PATH -end +if test -n "$RBENV_ROOT" + if test -d $RBENV_ROOT/bin + set PATH $RBENV_ROOT/bin $PATH + end -if test -d $HOME/.rbenv/shims - set PATH $HOME/.rbenv/shims $PATH + if test -d $RBENV_ROOT/shims + set PATH $RBENV_ROOT/shims $PATH + end +else + if test -d $HOME/.rbenv/bin + set PATH $HOME/.rbenv/bin $PATH + end + + if test -d $HOME/.rbenv/shims + set PATH $HOME/.rbenv/shims $PATH + end end