From 24143cf3fdc9c736f44aecb86e0a574175468622 Mon Sep 17 00:00:00 2001 From: milky0217 Date: Sun, 7 Jun 2026 16:42:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20deploy.sh=E8=93=9D=E7=BB=BF=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E6=97=B6service=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E6=8C=89target=E5=8C=BA=E5=88=86(common.sh=20get=5Fservice=5Ff?= =?UTF-8?q?ile=5Flocal)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/common.sh b/lib/common.sh index 2cc6360..14cf603 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -63,7 +63,14 @@ EOF } # ---------- 环境配置(systemd service)---------- -get_service_file_local() { echo "${SCRIPT_DIR}/deploy/rust-backend-${APP_ENV}.service"; } +get_service_file_local() { + local target="${BG_TARGET:-}" + if [ -n "$target" ]; then + echo "${SCRIPT_DIR}/deploy/rust-backend-${target}.service" + else + echo "${SCRIPT_DIR}/deploy/rust-backend-${APP_ENV}.service" + fi +} check_service_file() { log_step "检查远程 systemd service 文件..."