Created
November 7, 2013 15:13
-
-
Save sionide21/7356242 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
ve() { | |
local curdir ve | |
curdir="$PWD" | |
[ -z "$1" ] && ve="ve" || ve="$1" | |
while ! ls -d "$ve" >/dev/null 2>&1; do | |
if [ "$PWD" == "/" ]; then | |
echo "Cannot find a '$ve' directory on the current path" >&2 | |
cd $curdir | |
return -1 | |
fi | |
cd .. | |
done | |
echo "Using $PWD" | |
source "$ve/bin/activate" | |
cd "$curdir" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment