Skip to content

Instantly share code, notes, and snippets.

@elijahr
Created July 17, 2012 23:37
Show Gist options
  • Save elijahr/3132934 to your computer and use it in GitHub Desktop.
Save elijahr/3132934 to your computer and use it in GitHub Desktop.
work on virtualenv
#### automatically activate virtualenvs - from http://toranbillups.com/blog/archive/2012/4/22/Automatically-activate-your-virtualenv
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"
# if there is a virtualenv in the cwd, activate it
workon_virtualenv
#### /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment