Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit e9a9deacb09196a48a39adc827d861e1896f4c59 1 parent e8d582a
Tima Maslyuchenko timsly authored

Showing 1 changed file with 14 additions and 1 deletion. Show diff stats Hide diff stats

  1. +14 1 plugins/rbenv/rbenv.plugin.zsh
15 plugins/rbenv/rbenv.plugin.zsh
... ... @@ -1,5 +1,18 @@
  1 +function is_homebrew_installed() {
  2 + type brew &> /dev/null
  3 +}
  4 +
  5 +function is_rbenv_installed() {
  6 + brew --prefix rbenv &> /dev/null
  7 +}
  8 +
1 9 FOUND_RBENV=0
2   -for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do
  10 +rbenvdirs=("$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv")
  11 +if is_homebrew_installed && is_rbenv_installed ; then
  12 + rbenvdirs=($(brew --prefix rbenv) "${rbenvdirs[@]}")
  13 +fi
  14 +
  15 +for rbenvdir in "${rbenvdirs[@]}" ; do
3 16 if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
4 17 FOUND_RBENV=1
5 18 export RBENV_ROOT=$rbenvdir

0 comments on commit e9a9dea

Please sign in to comment.
Something went wrong with that request. Please try again.