1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-22 17:28:01 +00:00

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