summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Cavigneaux <nico@bounga.org>2017-11-06 15:43:03 +0100
committerRobby Russell <robby@planetargon.com>2017-11-06 06:43:03 -0800
commit9dab0af11f22f91c98a77892a14b16ca7fa7fbb4 (patch)
treed81956a8dc46d4fe1ee9645b1b6853de7a2807b2
parentd072c0fbec58439ede849facf89fa11225dd85d9 (diff)
downloadzsh-9dab0af11f22f91c98a77892a14b16ca7fa7fbb4.tar.gz
zsh-9dab0af11f22f91c98a77892a14b16ca7fa7fbb4.tar.bz2
zsh-9dab0af11f22f91c98a77892a14b16ca7fa7fbb4.zip
Set RBENV_ROOT to "$HOME/.rbenv" if not already set (#6324)
This is the default behavior of rbenv and what users are expecting most of the time. It allows users to have their own set of rubies and gems. It also prevents losing all rubies when rbenv is updated using Homebrew which is not true when RBENV_ROOT is set to /usr/local/opt/rbenv.
-rw-r--r--plugins/rbenv/rbenv.plugin.zsh3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/rbenv/rbenv.plugin.zsh b/plugins/rbenv/rbenv.plugin.zsh
index ef5106f2d..7430e9625 100644
--- a/plugins/rbenv/rbenv.plugin.zsh
+++ b/plugins/rbenv/rbenv.plugin.zsh
@@ -7,6 +7,9 @@ rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" "/usr/local/opt/rbenv"
if _homebrew-installed && rbenv_homebrew_path=$(brew --prefix rbenv 2>/dev/null); then
rbenvdirs=($rbenv_homebrew_path "${rbenvdirs[@]}")
unset rbenv_homebrew_path
+ if [[ $RBENV_ROOT = '' ]]; then
+ RBENV_ROOT="$HOME/.rbenv"
+ fi
fi
for rbenvdir in "${rbenvdirs[@]}" ; do