Commit 9dab0af1 authored by Nicolas Cavigneaux's avatar Nicolas Cavigneaux Committed by Robby Russell
Browse files

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.
parent d072c0fb
...@@ -7,6 +7,9 @@ rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" "/usr/local/opt/rbenv" ...@@ -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 if _homebrew-installed && rbenv_homebrew_path=$(brew --prefix rbenv 2>/dev/null); then
rbenvdirs=($rbenv_homebrew_path "${rbenvdirs[@]}") rbenvdirs=($rbenv_homebrew_path "${rbenvdirs[@]}")
unset rbenv_homebrew_path unset rbenv_homebrew_path
if [[ $RBENV_ROOT = '' ]]; then
RBENV_ROOT="$HOME/.rbenv"
fi
fi fi
for rbenvdir in "${rbenvdirs[@]}" ; do for rbenvdir in "${rbenvdirs[@]}" ; do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment