From 2c54428d6e3c683e5b01b30d8405232f98668691 Mon Sep 17 00:00:00 2001
From: Superbil <superbil@gmail.com>
Date: Sat, 17 Oct 2015 05:55:29 +0800
Subject: Fixd bug for pyenv plugin

Check pyenv-virtualenv can eval before use it.

Signed-off-by: Superbil <superbil@gmail.com>
---
 plugins/pyenv/pyenv.plugin.zsh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'plugins')

diff --git a/plugins/pyenv/pyenv.plugin.zsh b/plugins/pyenv/pyenv.plugin.zsh
index b06507b62..aa1f9488a 100644
--- a/plugins/pyenv/pyenv.plugin.zsh
+++ b/plugins/pyenv/pyenv.plugin.zsh
@@ -18,7 +18,10 @@ for pyenvdir in "${pyenvdirs[@]}" ; do
         export PYENV_ROOT=$pyenvdir
         export PATH=${pyenvdir}/bin:$PATH
         eval "$(pyenv init - zsh)"
-        eval "$(pyenv virtualenv-init - zsh)"
+
+        if pyenv commands | command grep -q virtualenv-init; then
+            eval "$(pyenv virtualenv-init - zsh)"
+        fi
 
         function pyenv_prompt_info() {
             echo "$(pyenv version-name)"
-- 
cgit v1.2.3-70-g09d2