diff --git a/scripts/library/python.sh b/scripts/library/python.sh index e1dd8274..b1c00f8b 100644 --- a/scripts/library/python.sh +++ b/scripts/library/python.sh @@ -1,6 +1,13 @@ #!/bin/sh # shellcheck disable=SC1091 +check_venv(){ + # activate python venv + [ -d venv ] || setup_venv + . venv/bin/activate + [ -e requirements.txt ] && pip install -q -r requirements.txt +} + setup_venv(){ python3 -m venv venv . venv/bin/activate @@ -8,10 +15,3 @@ setup_venv(){ check_venv || usage } - -check_venv(){ - # activate python venv - [ -d venv ] || setup_venv - . venv/bin/activate - [ -e requirements.txt ] && pip install -q -r requirements.txt -}