Skip to content

Instantly share code, notes, and snippets.

@bjorgvino
Created January 16, 2015 15:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bjorgvino/455618ecbc1536bb3333 to your computer and use it in GitHub Desktop.
Save bjorgvino/455618ecbc1536bb3333 to your computer and use it in GitHub Desktop.
autoenv template file
venv=<environment>
currentvenv=""
if [[ $VIRTUAL_ENV != "" ]]
then
# Strip out the path and just leave the env name
currentvenv="${VIRTUAL_ENV##*/}"
fi
if [[ "$currentvenv" != "$venv" ]]
then
echo "Switching to environment: $venv"
workon $venv
#else
# echo "Already on environment $venv"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment