1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-25 15:20:08 +00:00

rbenv plugin now uses 'brew --prefix rbenv' command to find rbenv folder

This commit is contained in:
Tima Maslyuchenko 2012-06-18 20:15:57 +03:00
parent e8d582aba9
commit e9a9deacb0

View file

@ -1,5 +1,18 @@
function is_homebrew_installed() {
type brew &> /dev/null
}
function is_rbenv_installed() {
brew --prefix rbenv &> /dev/null
}
FOUND_RBENV=0
for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do
rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv")
if is_homebrew_installed && is_rbenv_installed ; then
rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}")
fi
for rbenvdir in "${rbenvdirs[@]}" ; do
if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
FOUND_RBENV=1
export RBENV_ROOT=$rbenvdir