mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-29 04:53:17 +02:00
Merge c2eab39779 into 9edb3fceba
This commit is contained in:
commit
274da59134
1 changed files with 5 additions and 8 deletions
|
|
@ -2,14 +2,11 @@ _homebrew-installed() {
|
||||||
type brew &> /dev/null
|
type brew &> /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
_pyenv-from-homebrew-installed() {
|
|
||||||
brew --prefix pyenv &> /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
FOUND_PYENV=0
|
FOUND_PYENV=0
|
||||||
pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv")
|
pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv")
|
||||||
if _homebrew-installed && _pyenv-from-homebrew-installed ; then
|
if _homebrew-installed && pyenv_homebrew_path=$(brew --prefix pyenv 2>/dev/null); then
|
||||||
pyenvdirs=($(brew --prefix pyenv) "${pyenvdirs[@]}")
|
pyenvdirs=($pyenv_homebrew_path "${pyenvdirs[@]}")
|
||||||
|
unset pyenv_homebrew_path
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for pyenvdir in "${pyenvdirs[@]}" ; do
|
for pyenvdir in "${pyenvdirs[@]}" ; do
|
||||||
|
|
@ -17,7 +14,7 @@ for pyenvdir in "${pyenvdirs[@]}" ; do
|
||||||
FOUND_PYENV=1
|
FOUND_PYENV=1
|
||||||
export PYENV_ROOT=$pyenvdir
|
export PYENV_ROOT=$pyenvdir
|
||||||
export PATH=${pyenvdir}/bin:$PATH
|
export PATH=${pyenvdir}/bin:$PATH
|
||||||
eval "$(pyenv init - zsh)"
|
eval "$(pyenv init --no-rehash - zsh)"
|
||||||
|
|
||||||
if pyenv commands | command grep -q virtualenv-init; then
|
if pyenv commands | command grep -q virtualenv-init; then
|
||||||
eval "$(pyenv virtualenv-init - zsh)"
|
eval "$(pyenv virtualenv-init - zsh)"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue