mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-18 10:22:00 +00:00
fix(pyenv): do not warn if PYENV_ROOT is undefined (#10162)
Co-authored-by: Terry Moschou <terry.moschou@fivecast.com>
This commit is contained in:
parent
1b03896a0e
commit
19710a2d17
1 changed files with 4 additions and 4 deletions
|
@ -62,14 +62,14 @@ if [[ $FOUND_PYENV -ne 1 ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $FOUND_PYENV -eq 1 ]]; then
|
if [[ $FOUND_PYENV -eq 1 ]]; then
|
||||||
# Setup $PYENV_ROOT if not already set
|
|
||||||
if [[ -z "$PYENV_ROOT" ]]; then
|
if [[ -z "$PYENV_ROOT" ]]; then
|
||||||
|
# This is only for backwards compatibility with users that previously relied
|
||||||
|
# on this plugin exporting it. pyenv itself does not require it to be exported
|
||||||
export PYENV_ROOT="$(pyenv root)"
|
export PYENV_ROOT="$(pyenv root)"
|
||||||
pyenv_config_warning 'missing $PYENV_ROOT'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add pyenv shims to $PATH if not already added
|
# Add pyenv shims to $PATH if not already added
|
||||||
if [[ -z "${path[(Re)$PYENV_ROOT/shims]}" ]]; then
|
if [[ -z "${path[(Re)$(pyenv root)/shims]}" ]]; then
|
||||||
eval "$(pyenv init --path)"
|
eval "$(pyenv init --path)"
|
||||||
pyenv_config_warning 'missing pyenv shims in $PATH'
|
pyenv_config_warning 'missing pyenv shims in $PATH'
|
||||||
fi
|
fi
|
||||||
|
@ -78,7 +78,7 @@ if [[ $FOUND_PYENV -eq 1 ]]; then
|
||||||
eval "$(pyenv init - --no-rehash zsh)"
|
eval "$(pyenv init - --no-rehash zsh)"
|
||||||
|
|
||||||
# If pyenv-virtualenv exists, load it
|
# If pyenv-virtualenv exists, load it
|
||||||
if [[ -d "$PYENV_ROOT/plugins/pyenv-virtualenv" && "$ZSH_PYENV_VIRTUALENV" != false ]]; then
|
if [[ -d "$(pyenv root)/plugins/pyenv-virtualenv" && "$ZSH_PYENV_VIRTUALENV" != false ]]; then
|
||||||
eval "$(pyenv virtualenv-init - zsh)"
|
eval "$(pyenv virtualenv-init - zsh)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue