mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Base rbenv plugin on the rbenv in the path.
Rather than do our own searching, this gives the user full control of the PATH variable and of the search order for rbenv. It's also probably faster, since we let zsh do the searching for us.
This commit is contained in:
parent
bf529e7d63
commit
c4a5ac62c8
1 changed files with 1 additions and 19 deletions
|
|
@ -1,22 +1,4 @@
|
||||||
FOUND_RBENV=0
|
if [[ $+commands[rbenv] -eq 1 ]] ; then
|
||||||
for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do
|
|
||||||
if [ -d $rbenvdir/bin -a $FOUND_RBENV -eq 0 ] ; then
|
|
||||||
FOUND_RBENV=1
|
|
||||||
export RBENV_ROOT=$rbenvdir
|
|
||||||
export PATH=${rbenvdir}/bin:$PATH
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
unset rbenvdir
|
|
||||||
|
|
||||||
# If not found above, check for the existence of the rbenv executable anyway.
|
|
||||||
if [ $FOUND_RBENV -eq 0 ] ; then
|
|
||||||
if ( which rbenv > /dev/null 2>&1 ) ; then
|
|
||||||
FOUND_RBENV=1
|
|
||||||
export RBENV_ROOT=$(rbenv root)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $FOUND_RBENV -eq 1 ] ; then
|
|
||||||
|
|
||||||
eval "$(rbenv init -)"
|
eval "$(rbenv init -)"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue