From 47a977a0699bd7cec1a432908f05882975b45858 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Fri, 27 Sep 2024 17:04:07 +0200 Subject: [PATCH] maintenance.sh: create venv if it does not exist --- maintenance.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/maintenance.sh b/maintenance.sh index 26cd457..d60c52e 100755 --- a/maintenance.sh +++ b/maintenance.sh @@ -4,9 +4,10 @@ set -Eeuo pipefail SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) update_venv() { - if [ -d "venv" ]; then - venv/bin/pip install -r requirements.txt >/dev/null + if [ ! -d "venv" ]; then + python3 -m venv venv fi + venv/bin/pip install -r requirements.txt >/dev/null } update_apps_repo() { @@ -18,7 +19,7 @@ update_apps_repo() { } update_apps_cache() { - ./app_caches.py -d -l .apps -c .apps_cache -j20 + venv/bin/python3 ./app_caches.py -d -l .apps -c .apps_cache -j20 } git_pull_and_restart_services() {