Created
February 13, 2014 02:21
-
-
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)
This file contains hidden or 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
| #!/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