mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-28 17:28:56 +01:00
Merge pull request #3352 from benjaoming/virtualenvwrapper_workon_unset
Throw an error message when $WORKON_HOME is not set
This commit is contained in:
commit
b0ad3d7c70
@ -1,7 +1,12 @@
|
|||||||
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
|
|||||||
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…
Reference in New Issue
Block a user