Created
December 8, 2010 20:33
-
-
Save SmileyChris/733871 to your computer and use it in GitHub Desktop.
~/.virtualenvs/postactivate: switch to working directory initially if it exists, and allow switiching between the env root and the working directory by typing "cd"
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
WORKDIR=$HOME/work/`basename $VIRTUAL_ENV` | |
cd () { | |
if (( $# == 0 )); then | |
if [ -d $WORKDIR ] && [ `pwd` != $WORKDIR ]; then | |
builtin cd $WORKDIR | |
else | |
builtin cd $VIRTUAL_ENV | |
fi | |
else | |
builtin cd "$@" | |
fi | |
} | |
if [ -d $WORKDIR ]; then | |
cd $WORKDIR | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment