Commit 4b05e548 authored by benjaoming's avatar benjaoming Committed by Benjamin Bach
Browse files

Throw an error message when $WORKON_HOME is not set

Took me a while to figure this one out, and I have a default installation of virtualenvwrapper -- this is a soft fix, just put an error message. But perhaps the fix should be to use the default value `~/.virtualenvs`.
parent 43aa3783
virtualenvwrapper='virtualenvwrapper.sh' virtualenvwrapper='virtualenvwrapper.sh'
if (( $+commands[$virtualenvwrapper] )); then if (( $+commands[$virtualenvwrapper] )); then
source ${${virtualenvwrapper}:c} source ${${virtualenvwrapper}:c}
if [[ "$WORKON_HOME" == "" ]]; then
echo "\$WORKON_HOME is not defined so ZSH plugin virtualenvwrapper will not work"
else
if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
# Automatically activate Git projects's virtual environments based on the # Automatically activate Git projects's virtual environments based on the
# directory name of the project. Virtual environment name can be overridden # directory name of the project. Virtual environment name can be overridden
...@@ -54,6 +59,7 @@ if (( $+commands[$virtualenvwrapper] )); then ...@@ -54,6 +59,7 @@ if (( $+commands[$virtualenvwrapper] )); then
set -A chpwd_functions workon_cwd set -A chpwd_functions workon_cwd
fi fi
fi fi
fi
else else
print "zsh virtualenvwrapper plugin: Cannot find ${virtualenvwrapper}. Please install with \`pip install virtualenvwrapper\`." print "zsh virtualenvwrapper plugin: Cannot find ${virtualenvwrapper}. Please install with \`pip install virtualenvwrapper\`."
fi fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment