From d99577dc5ca7451d5c344f9f73c5b34e94f6cb8a Mon Sep 17 00:00:00 2001 From: Hermes CI Fix Date: Tue, 11 Aug 2026 11:14:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20deploy.sh=20venv=E6=BF=80=E6=B4=BB?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=20=E2=80=94=20=E7=B2=BE=E7=AE=80venv?= =?UTF-8?q?=E6=97=A0activate=E6=97=B6=E7=9B=B4=E6=8E=A5=E7=94=A8venv/bin/p?= =?UTF-8?q?ip3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deploy.sh b/deploy.sh index 9f7fda77..e0353540 100755 --- a/deploy.sh +++ b/deploy.sh @@ -28,9 +28,13 @@ echo " ✓ 部署完成" # 3. 更新后端依赖 echo "[3/4] 更新后端..." cd "$SCRIPT_DIR/backend" -source venv/bin/activate -pip install -r requirements.txt --quiet --no-cache-dir -deactivate +if [ -f venv/bin/activate ]; then + source venv/bin/activate + pip install -r requirements.txt --quiet --no-cache-dir + deactivate +else + venv/bin/pip3 install -r requirements.txt --quiet --no-cache-dir || venv/bin/pip install -r requirements.txt --quiet --no-cache-dir +fi echo " ✓ 依赖更新完成" # 4. 重启后端服务