Created
July 9, 2012 13:54
-
-
Save FSX/3076710 to your computer and use it in GitHub Desktop.
Some helper functions for Virtualenv.
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
#!/bin/bash | |
# Add to ~/.bashrc | |
# source /path/to/virtualenv-funcs.sh | |
# Usage: command virtualenv-name python-version | |
# Examples: | |
# mkenv momoko 2 | |
# workon momoko 2 | |
# delenv momoko 2 | |
mkenv () { | |
virtualenv --prompt="($1:$2) " -p "python$2" "/home/$(whoami)/.env/$1-$2" | |
} | |
workon () { | |
source "/home/$(whoami)/.env/$1-$2/bin/activate" | |
} | |
delenv () { | |
rm -rf "/home/$(whoami)/.env/$1-$2" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment