diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 78fc608..967a3bb 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -17,9 +17,11 @@ echo "-- Shell: Source profile in case it's been updated" # shellcheck source="$HOME/.profile" disable=SC1091 source "$HOME/.profile" -echo "-- Activate Python virtual environment" -# shellcheck source="../.venv/bin/activate" -source .venv/bin/activate +if [[ ! $(pip -V) =~ .*\.venv.* ]]; then + echo "-- Python: Activate '.venv' virtual environment" + # shellcheck source="../.venv/bin/activate" disable=SC1091 + source .venv/bin/activate +fi echo "-- Install project Python requirements in venv" pip install -r requirements.txt diff --git a/scripts/python_setup.sh b/scripts/python_setup.sh index 4ce5926..04dd888 100755 --- a/scripts/python_setup.sh +++ b/scripts/python_setup.sh @@ -23,9 +23,11 @@ if [ ! -d .venv ]; then python3 -m venv .venv fi -echo "-- Python: Activate '.venv' virtual environment" -# shellcheck source="../.venv/bin/activate" -source .venv/bin/activate +if [[ ! $(pip -V) =~ .*\.venv.* ]]; then + echo "-- Python: Activate '.venv' virtual environment" + # shellcheck source="../.venv/bin/activate" disable=SC1091 + source .venv/bin/activate +fi echo "-- Upgrage Python pip and setuptools in venv" pip install --upgrade setuptools pip