Created
March 18, 2013 20:10
-
-
Save ajself/5190389 to your computer and use it in GitHub Desktop.
a simple hack to change virtualenvs ala .rvmrc like. Create a file called .venv in the project dir with the name of the virtualenv you want to use. This infers you are using pythonbrew.
This file contains hidden or 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
has_virtualenv() { | |
if [ -e .venv ]; then | |
pybrew venv use `cat .venv` | |
fi | |
} | |
venv_cd () { | |
cd "$@" && has_virtualenv | |
} | |
alias cd="venv_cd" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment