mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Simplify alternate search for rbenv executable.
Rather than iterating over the entire $PATH, just try `which rbenv` similar to the Bundler plugin.
This commit is contained in:
parent
738ce0caba
commit
bf529e7d63
1 changed files with 5 additions and 8 deletions
|
|
@ -8,15 +8,12 @@ for rbenvdir in "$HOME/.rbenv" "/usr/local/rbenv" "/opt/rbenv" ; do
|
||||||
done
|
done
|
||||||
unset rbenvdir
|
unset rbenvdir
|
||||||
|
|
||||||
# If not found above, check the rest of $PATH for an rbenv executable (usually installed
|
# If not found above, check for the existence of the rbenv executable anyway.
|
||||||
# in /usr/local/bin, but may be installed elsewhere)
|
|
||||||
if [ $FOUND_RBENV -eq 0 ] ; then
|
if [ $FOUND_RBENV -eq 0 ] ; then
|
||||||
for dir in ${path} ; do
|
if ( which rbenv > /dev/null 2>&1 ) ; then
|
||||||
if [ -x $dir/rbenv ] ; then
|
|
||||||
FOUND_RBENV=1
|
FOUND_RBENV=1
|
||||||
break
|
export RBENV_ROOT=$(rbenv root)
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $FOUND_RBENV -eq 1 ] ; then
|
if [ $FOUND_RBENV -eq 1 ] ; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue