Created
September 6, 2012 09:43
-
-
Save DazWorrall/3653962 to your computer and use it in GitHub Desktop.
Automatically switch to a directory with a matching name when entering a virtualenv
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
#!/bin/bash | |
# This hook is run after every virtualenv is activated. | |
venv=`basename "$VIRTUAL_ENV"` | |
if [ -d "$HOME/src/$venv" ]; then | |
cd "$HOME/src/$venv" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thats in ~/.virtualenvs/postactivate. I typically name my virtualenvs the same as the source repository, and typically check them out to the same place.