Last active
December 27, 2015 16:49
-
-
Save rosenhouse/7357628 to your computer and use it in GitHub Desktop.
python virtualenv for the lazy
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 -e | |
if [ "${BASH_SOURCE[0]}" == "${0}" ]; then | |
echo "source this!" | |
exit 1 | |
fi | |
if [ ! "$1" ]; then | |
echo "Name an environment!" | |
return 2 | |
fi | |
ve_root="$HOME/.virtualenvs" | |
mkdir -p $ve_root | |
pushd $ve_root | |
export VE="$ve_root/$1" | |
if [ ! -d "$1" ]; then | |
virtualenv $1 | |
else | |
echo "Existing virtualenv found." | |
fi | |
echo "Virtualenv path stored into shell env var 'VE'" | |
source $1/bin/activate | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment