Skip to content

Instantly share code, notes, and snippets.

@matt-snider
Created August 20, 2015 11:45
Show Gist options
  • Save matt-snider/e7008035acd903fa84e6 to your computer and use it in GitHub Desktop.
Save matt-snider/e7008035acd903fa84e6 to your computer and use it in GitHub Desktop.
# The following will check for a .venv file, and if it exists,
# automagically switch to working on that virtualenv.
#
# https://justin.abrah.ms/python/virtualenv_wrapper_helper.html
source /usr/bin/virtualenvwrapper.sh
function prompt()
{
if [ "$PWD" != "$MYOLDPWD" ]; then
MYOLDPWD="$PWD"
test -e .venv && workon `cat .venv`
fi
}
PROMPT_COMMAND='prompt'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment