summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2021-08-18 11:47:50 +0200
committerMarc Cornellà <hello@mcornella.com>2021-08-18 11:51:19 +0200
commitb85e1dd5d6b0ee527b313ce8c902bbc4e34e36e0 (patch)
tree4bfc77a3370e4b7fee1e79b6592e661cf3f0ad7c /plugins
parent10f3e0d4d498c68109bafd711d0bae7f6fa44071 (diff)
downloadzsh-b85e1dd5d6b0ee527b313ce8c902bbc4e34e36e0.tar.gz
zsh-b85e1dd5d6b0ee527b313ce8c902bbc4e34e36e0.tar.bz2
zsh-b85e1dd5d6b0ee527b313ce8c902bbc4e34e36e0.zip
fix(pyenv): fix for checking if pyenv-virtualenv is installed
Fixes #8467
Diffstat (limited to 'plugins')
-rw-r--r--plugins/pyenv/pyenv.plugin.zsh8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh
index 275c12c80..bcf80a6a2 100644
--- a/plugins/pyenv/pyenv.plugin.zsh
+++ b/plugins/pyenv/pyenv.plugin.zsh
@@ -46,16 +46,20 @@ For more info go to https://github.com/pyenv/pyenv/#installation.
EOF
# Configuring in .zshrc only makes pyenv available for interactive shells
- export PYENV_ROOT=$dir
+ export PYENV_ROOT="$dir"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
fi
fi
if [[ $FOUND_PYENV -eq 1 ]]; then
+ if [[ -z "$PYENV_ROOT" ]]; then
+ export PYENV_ROOT="$(pyenv root)"
+ fi
+
eval "$(pyenv init - --no-rehash zsh)"
- if (( ${+commands[pyenv-virtualenv-init]} )); then
+ if [[ -d "$PYENV_ROOT/plugins/pyenv-virtualenv" ]]; then
eval "$(pyenv virtualenv-init - zsh)"
fi