Created
March 3, 2020 19:20
-
-
Save tom-doerr/41184ec7bcaf5f61d128d306361a8e79 to your computer and use it in GitHub Desktop.
Bash function that activates a Python virtual environment and creates the environment if it doesn't yet exist
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
ve() { | |
if [[ ! $VIRTUAL_ENV ]] | |
then | |
if [ ! -d venv ] | |
then | |
virtualenv --no-site-packages venv | |
fi | |
source venv/bin/activate | |
else | |
deactivate | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment