Add support for skipping VIRTUALENVWRAPPER init in modules/python (#598)

* Support skip-virtualenvwrapper-init zstyle in python module to avoid auto-sourcing of virtualenvwrapper.sh
* Don't overwrite the WORKON_HOME env var if the user has already set it
This commit is contained in:
Calvin Smith 2017-04-03 23:06:02 -07:00 committed by Kaleb Elwert
parent 5271af8180
commit a7729561e8

View file

@ -34,10 +34,11 @@ if (( ! $+commands[python] && ! $+commands[pyenv] )); then
return 1
fi
# Load virtualenvwrapper into the shell session.
if (( $+commands[virtualenvwrapper.sh] )); then
# Load virtualenvwrapper into the shell session, unless requested not to
zstyle -t ':prezto:module:python' skip-virtualenvwrapper-init
if (( $? && $+commands[virtualenvwrapper.sh] )); then
# Set the directory where virtual environments are stored.
export WORKON_HOME="$HOME/.virtualenvs"
export WORKON_HOME="${WORKON_HOME:-$HOME/.virtualenvs}"
# Disable the virtualenv prompt.
VIRTUAL_ENV_DISABLE_PROMPT=1