diff options
author | Terry <tmoschou@gmail.com> | 2021-09-06 18:02:19 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-06 10:32:19 +0200 |
commit | 19710a2d17d69dc0315465875c4becbf5e4ead38 (patch) | |
tree | ee5313bf1aa08d4624d9a1b907300e6fc2ce0a7a /plugins/pyenv/pyenv.plugin.zsh | |
parent | 1b03896a0e01ad263439449a0742d0f3339732e2 (diff) | |
download | zsh-19710a2d17d69dc0315465875c4becbf5e4ead38.tar.gz zsh-19710a2d17d69dc0315465875c4becbf5e4ead38.tar.bz2 zsh-19710a2d17d69dc0315465875c4becbf5e4ead38.zip |
fix(pyenv): do not warn if PYENV_ROOT is undefined (#10162)
Co-authored-by: Terry Moschou <terry.moschou@fivecast.com>
Diffstat (limited to 'plugins/pyenv/pyenv.plugin.zsh')
-rw-r--r-- | plugins/pyenv/pyenv.plugin.zsh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh index 922df8ead..d91b5daa7 100644 --- a/plugins/pyenv/pyenv.plugin.zsh +++ b/plugins/pyenv/pyenv.plugin.zsh @@ -62,14 +62,14 @@ if [[ $FOUND_PYENV -ne 1 ]]; then fi if [[ $FOUND_PYENV -eq 1 ]]; then - # Setup $PYENV_ROOT if not already set 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)" - pyenv_config_warning 'missing $PYENV_ROOT' fi # 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)" pyenv_config_warning 'missing pyenv shims in $PATH' fi @@ -78,7 +78,7 @@ if [[ $FOUND_PYENV -eq 1 ]]; then eval "$(pyenv init - --no-rehash zsh)" # 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)" fi |