2c54428d6e3c683e5b01b30d8405232f98668691
- Author
- Superbil <superbil@gmail.com>
- Committer
- Superbil <superbil@gmail.com>
- Date
Message
Fixd bug for pyenv plugin
Check pyenv-virtualenv can eval before use it.
Signed-off-by: Superbil <superbil@gmail.com>
Diff
1diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh
2index b06507b62f9e397ef35680e90987566ec498b58f..aa1f9488aed5f1165305c88cad21d10d9d9fb115 100644
3--- a/plugins/pyenv/pyenv.plugin.zsh
4+++ b/plugins/pyenv/pyenv.plugin.zsh
5@@ -18,7 +18,10 @@ for pyenvdir in "${pyenvdirs[@]}" ; do
6 export PYENV_ROOT=$pyenvdir
7 export PATH=${pyenvdir}/bin:$PATH
8 eval "$(pyenv init - zsh)"
9- eval "$(pyenv virtualenv-init - zsh)"
10+
11+ if pyenv commands | command grep -q virtualenv-init; then
12+ eval "$(pyenv virtualenv-init - zsh)"
13+ fi
14
15 function pyenv_prompt_info() {
16 echo "$(pyenv version-name)"