Set the virtualenvwrapper $WORKON_HOME variable

This commit is contained in:
Sorin Ionescu 2012-09-03 10:53:19 -04:00
parent 6e664690ef
commit f8689401de
2 changed files with 10 additions and 6 deletions

View file

@ -6,7 +6,7 @@ Enables local Python and local Python package installation.
Local Python Installation Local Python Installation
------------------------- -------------------------
[pythonz][6] builds and installs multiple Python versions locally in the home [pythonz][4] builds and installs multiple Python versions locally in the home
directory. directory.
This module prepends the pythonz directory to the path variable to enable the This module prepends the pythonz directory to the path variable to enable the
@ -41,8 +41,9 @@ convenient shell functions to create, switch, and manage them.
### Usage ### Usage
Install virtualenvwrapper and set [`$WORKON_HOME`][4] to the path where virtual Install virtualenvwrapper.
environments will be stored.
Virtual environments are stored in *~/.virtualenvs*.
### Theming ### Theming
@ -87,7 +88,6 @@ Authors
[1]: http://www.python.org/dev/peps/pep-0370/ [1]: http://www.python.org/dev/peps/pep-0370/
[2]: http://www.doughellmann.com/projects/virtualenvwrapper/ [2]: http://www.doughellmann.com/projects/virtualenvwrapper/
[3]: http://pypi.python.org/pypi/virtualenv [3]: http://pypi.python.org/pypi/virtualenv
[4]: http://www.doughellmann.com/docs/virtualenvwrapper/#introduction [4]: http://saghul.github.com/pythonz/
[5]: https://github.com/sorin-ionescu/oh-my-zsh/issues [5]: https://github.com/sorin-ionescu/oh-my-zsh/issues
[6]: http://saghul.github.com/pythonz/

View file

@ -23,9 +23,13 @@ else
fi fi
# Load virtualenvwrapper into the shell session. # Load virtualenvwrapper into the shell session.
if [[ -n "$WORKON_HOME" ]] && (( $+commands[virtualenvwrapper_lazy.sh] )); then if (( $+commands[virtualenvwrapper_lazy.sh] )); then
# Set the directory where virtual environments are stored.
export WORKON_HOME=$HOME/.virtualenvs
# Disable the virtualenv prompt. # Disable the virtualenv prompt.
VIRTUAL_ENV_DISABLE_PROMPT=1 VIRTUAL_ENV_DISABLE_PROMPT=1
source "$commands[virtualenvwrapper_lazy.sh]" source "$commands[virtualenvwrapper_lazy.sh]"
fi fi