From d31b292d0ddbccefa637bce80c51e1286ac6edbd Mon Sep 17 00:00:00 2001 From: Graeme Coupar Date: Fri, 17 Aug 2012 15:58:45 +0100 Subject: [PATCH] Updated virtualenvwrapper plugin to use which Previously the virtualenvwrapper plugin contained some hard-coded paths to potential locations for virtualenvwrapper.sh. This works most of the time, however this falls apart if virtualenvwrapper.sh is not installed in one of the listed locations (for example if it's installed using pip --user). To fix, I've replaced the hard-coded /usr/bin and /usr/local/bin paths with `which virtualenvwrapper.sh`. This should find the shell script anywhere if it's on the path which seems like better behaviour than relying on it being in specific locations. --- plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh index 5d0860400..da0a6924d 100644 --- a/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh +++ b/plugins/virtualenvwrapper/virtualenvwrapper.plugin.zsh @@ -1,5 +1,5 @@ WRAPPER_FOUND=0 -for wrapsource in "/usr/bin/virtualenvwrapper.sh" "/usr/local/bin/virtualenvwrapper.sh" "/etc/bash_completion.d/virtualenvwrapper" ; do +for wrapsource in `which virtualenvwrapper.sh 2>&1` "/etc/bash_completion.d/virtualenvwrapper" ; do if [[ -e $wrapsource ]] ; then WRAPPER_FOUND=1 source $wrapsource