From 0b73975d04cf3d9533d4b61b1fc91c8b1cc3c079 Mon Sep 17 00:00:00 2001 From: Yukino Song Date: Tue, 10 Apr 2018 17:12:22 +0800 Subject: [PATCH 1/2] Add support for pyenv-virtualenv --- plugins/available/virtualenv.plugin.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/available/virtualenv.plugin.bash b/plugins/available/virtualenv.plugin.bash index 651bfec7..570a03d2 100644 --- a/plugins/available/virtualenv.plugin.bash +++ b/plugins/available/virtualenv.plugin.bash @@ -3,7 +3,11 @@ cite about-plugin about-plugin 'virtualenvwrapper helper functions' -[[ `which virtualenvwrapper.sh` ]] && . virtualenvwrapper.sh +if [[ `command -v pyenv` ]]; then + pyenv virtualenvwrapper +else + [[ `which virtualenvwrapper.sh` ]] && . virtualenvwrapper.sh +fi function mkvenv { From fa266e9b0c729db601decadb4bfc8da6a0018160 Mon Sep 17 00:00:00 2001 From: Yukino Song Date: Wed, 11 Apr 2018 14:59:56 +0800 Subject: [PATCH 2/2] Change to _command_exists helper --- plugins/available/virtualenv.plugin.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/available/virtualenv.plugin.bash b/plugins/available/virtualenv.plugin.bash index 570a03d2..468870cd 100644 --- a/plugins/available/virtualenv.plugin.bash +++ b/plugins/available/virtualenv.plugin.bash @@ -1,9 +1,9 @@ # make sure virtualenvwrapper is enabled if available cite about-plugin -about-plugin 'virtualenvwrapper helper functions' +about-plugin 'virtualenvwrapper and pyenv-virtualenvwrapper helper functions' -if [[ `command -v pyenv` ]]; then +if _command_exists pyenv; then pyenv virtualenvwrapper else [[ `which virtualenvwrapper.sh` ]] && . virtualenvwrapper.sh