mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
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`.
This commit is contained in:
parent
9f5a895192
commit
1934d9ad38
1 changed files with 52 additions and 46 deletions
|
|
@ -1,5 +1,10 @@
|
||||||
virtualenvwrapper='virtualenvwrapper_lazy.sh'
|
virtualenvwrapper='virtualenvwrapper_lazy.sh'
|
||||||
if (( $+commands[$virtualenvwrapper] )); then
|
if (( $+commands[$virtualenvwrapper] )); then
|
||||||
|
|
||||||
|
if [[ "$WORKON_HOME" == "" ]]; then
|
||||||
|
echo "\$WORKON_HOME is not defined so ZSH plugin virtualenvwrapper will not work"
|
||||||
|
else
|
||||||
|
|
||||||
source ${${virtualenvwrapper}:c}
|
source ${${virtualenvwrapper}:c}
|
||||||
|
|
||||||
if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
|
if [[ ! $DISABLE_VENV_CD -eq 1 ]]; then
|
||||||
|
|
@ -50,6 +55,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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue