Skip to content

Instantly share code, notes, and snippets.

@ajself
Created March 18, 2013 20:10
Show Gist options
  • Save ajself/5190389 to your computer and use it in GitHub Desktop.
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.
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