Skip to content

Commit

Permalink
scripts:python_setup: only source .env file if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
silopolis authored and JoAngel8 committed Dec 28, 2023
1 parent d3b316b commit 76d7c70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/python_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down

0 comments on commit 76d7c70

Please sign in to comment.