From 76d7c70f651a0cd20a0620f19e3eb7f460aaf478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Tarot=20=28=40silopolis=29?= Date: Thu, 28 Dec 2023 12:53:13 +0100 Subject: [PATCH] scripts:python_setup: only source `.env` file if it exists --- scripts/python_setup.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/python_setup.sh b/scripts/python_setup.sh index e4c7b7c..62eac84 100755 --- a/scripts/python_setup.sh +++ b/scripts/python_setup.sh @@ -7,7 +7,10 @@ cwd="$(pwd)" ## Change to project directory cd "$(dirname "$0")/.." # shellcheck source="../.env" -source .env +if [ -f .env ]; then + # shellcheck source="../.env" + source .env +fi ## Only compatible with Debian and Ubuntu if [[ ! $(dpkg -s python3-venv) ]]; then @@ -23,6 +26,7 @@ fi echo "-- Python: Activate '.venv' virtual environment" # shellcheck source="../.venv/bin/activate" source .venv/bin/activate + echo "-- Upgrage Python pip and setuptools in venv" pip install --upgrade setuptools pip echo "-- Install Python requirements in venv"