Created
February 29, 2012 14:06
-
-
Save d0ugal/1941104 to your computer and use it in GitHub Desktop.
Auto-activating virtualenvs with autoenv and virtualenvwrapper.
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
PROJECT_DIR="$(dirname "${BASH_SOURCE:-$0}" )"; | |
ABSOLUTE_DIR=`$SHELL -c "cd \"$PROJECT_DIR\" && pwd"`; | |
PROJECT_NAME="$( basename $ABSOLUTE_DIR)"; | |
if [[ -n $PROJECT_NAME && $VIRTUAL_ENV != *"$PROJECT_NAME" ]]; | |
then workon $PROJECT_NAME; | |
fi; | |
unset PROJECT_DIR; | |
unset ABSOLUTE_DIR; | |
unset PROJECT_NAME; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment