Created
October 27, 2015 19:25
-
-
Save douganger/a0a90769f422e1c57f51 to your computer and use it in GitHub Desktop.
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
# Find the innermost directory with an env and activate it. | |
env_root=$(pwd -P 2>/dev/null || command pwd) | |
while [ ! -e "$env_root/env" ]; do | |
env_root=${env_root%/*} | |
if [ "$env_root" = "" ]; then break; fi | |
done | |
if [ -n "$env_root" ]; then | |
source "$env_root/env/bin/activate" | |
else | |
if [ -n "$VIRTUAL_ENV" ] ; then deactivate; fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment