Created
July 23, 2012 17:59
-
-
Save elijahr/3165026 to your computer and use it in GitHub Desktop.
activate virtualenvs automatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### automatically activate virtualenvs named 'pyenv' | |
#### just put this at the end of your ~/.bashrc file | |
workon_virtualenv() { | |
if [ -e "${PWD}/pyenv" ]; then | |
deactivate >/dev/null 2>&1 | |
source "${PWD}/pyenv/bin/activate" | |
fi | |
} | |
virtualenv_cd() { | |
cd "$@" && workon_virtualenv | |
} | |
alias cd="virtualenv_cd" | |
workon_virtualenv | |
#### / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment