Skip to content

Instantly share code, notes, and snippets.

@spudfkc
Created February 13, 2014 02:21
Show Gist options
  • Save spudfkc/8968602 to your computer and use it in GitHub Desktop.
Save spudfkc/8968602 to your computer and use it in GitHub Desktop.
activates a python virtual environment based off the name of the current directory (usage: . ./virtualenvActivate)
#!/bin/bash
#
# Activates a given virtualenv. If no name is specified, the current directory
# is assumed to be the name.
#
STORE="/home/$USER/.virtualenv/env"
VE_SCRIPT="bin/activate"
VE_NAME=$1
if [[ -z "$VE_NAME" ]]
then
VE_NAME=$(basename $(pwd))
fi
source $STORE/$VE_NAME/$VE_SCRIPT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment