Created
July 19, 2020 19:09
-
-
Save altaurog/f79c611555ad3af1797e6ff73e2fb7bb to your computer and use it in GitHub Desktop.
virtualenvwrapper bootstrap script
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 | |
mkdir ~/.venv | |
python3 -m venv ~/.virtualenvs/venv | |
~/.virtualenvs/venv/bin/pip install virtualenvwrapper | |
if [ -n "`$SHELL -c 'echo $ZSH_VERSION'`" ]; then | |
config=~/.zshrc | |
elif [ -n "`$SHELL -c 'echo $BASH_VERSION'`" ]; then | |
config=~/.bashrc | |
else | |
echo >&2 "preferred shell unknown: $SHELL" | |
exit 1 | |
fi | |
VENVBIN="$HOME/.virtualenvs/venv/bin" | |
cat > $config <<EOF | |
export VIRTUALENVWRAPPER_PYTHON="$VENVBIN/python" | |
export VIRTUALENVWRAPPER_VIRTUALENV="$VENVBIN/virtualenv" | |
source "$VENVBIN/virtualenvwrapper.sh" | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment