Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
daedfcab
Commit
daedfcab
authored
Aug 15, 2015
by
Gabe Martin-Dempesy
Browse files
reduce rbenv plugin load time by 150ms by removing additional brew call
parent
a207a38d
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/rbenv/rbenv.plugin.zsh
View file @
daedfcab
...
@@ -2,14 +2,11 @@ _homebrew-installed() {
...
@@ -2,14 +2,11 @@ _homebrew-installed() {
type
brew &> /dev/null
type
brew &> /dev/null
}
}
_rbenv-from-homebrew-installed
()
{
brew
--prefix
rbenv &> /dev/null
}
FOUND_RBENV
=
0
FOUND_RBENV
=
0
rbenvdirs
=(
"
$HOME
/.rbenv"
"/usr/local/rbenv"
"/opt/rbenv"
"/usr/local/opt/rbenv"
)
rbenvdirs
=(
"
$HOME
/.rbenv"
"/usr/local/rbenv"
"/opt/rbenv"
"/usr/local/opt/rbenv"
)
if
_homebrew-installed
&&
_rbenv-from-homebrew-installed
;
then
if
_homebrew-installed
&&
rbenv_homebrew_path
=
$(
brew
--prefix
rbenv 2>/dev/null
)
;
then
rbenvdirs
=(
$(
brew
--prefix
rbenv
)
"
${
rbenvdirs
[@]
}
"
)
rbenvdirs
=(
$rbenv_homebrew_path
"
${
rbenvdirs
[@]
}
"
)
unset
rbenv_homebrew_path
fi
fi
for
rbenvdir
in
"
${
rbenvdirs
[@]
}
"
;
do
for
rbenvdir
in
"
${
rbenvdirs
[@]
}
"
;
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment