Skip to content

Instantly share code, notes, and snippets.

@SmileyChris
Created December 28, 2011 00:53
Show Gist options
  • Save SmileyChris/1525595 to your computer and use it in GitHub Desktop.
Save SmileyChris/1525595 to your computer and use it in GitHub Desktop.
PS1="(`basename \"$VIRTUAL_ENV\"`\$(__git_ps1 :%s))$_OLD_VIRTUAL_PS1"
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