Created
February 13, 2014 02:22
-
-
Save spudfkc/8968611 to your computer and use it in GitHub Desktop.
makes a python virtualenv from the name of the current directory. stores all virtualenvs in a common location
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 | |
| # | |
| # usage: mkvirtualenv [any virtualenv params] | |
| # | |
| # Creates a virtualenv in the directory defined by STORE using the current | |
| # directory's name as the virtualenv name. | |
| # | |
| STORE="/home/$USER/.virtualenv/env" | |
| if [ ! -d $STORE ] | |
| then | |
| echo "Virtualenv storage does not exist!" | |
| echo "Creating storage: $STORE" | |
| mkdir -p $STORE | |
| fi | |
| VIRTUAL_ENV=$(which virtualenv) | |
| ENV_NAME=$(basename $(pwd)) | |
| if [[ "$ENV_NAME" == "." ]] | |
| then | |
| echo "is ." | |
| fi | |
| echo "Making virtualenv: $ENV_NAME" | |
| PARAMS="$@ $STORE/$ENV_NAME" | |
| exec $VIRTUAL_ENV $PARAMS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment