From b7280cf5440d373460cfa0fdd26892a34d9d0fc3 Mon Sep 17 00:00:00 2001 From: Rei Date: Wed, 30 Sep 2026 16:45:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9B=B4=E6=96=B0=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E9=9D=99=E6=80=81=E6=96=87=E4=BB=B6=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/update-and-restart.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/update-and-restart.sh b/scripts/update-and-restart.sh index bed8684..eddf0e2 100755 --- a/scripts/update-and-restart.sh +++ b/scripts/update-and-restart.sh @@ -48,9 +48,9 @@ fi log '备份 MySQL 数据库' install -d -m 700 "$BACKUP_DIR" -umask 077 BACKUP_FILE="$BACKUP_DIR/ameiba_cms_$(date '+%Y%m%d_%H%M%S').sql.gz" ( + umask 077 set -a # shellcheck disable=SC1090 source "$CMS_ENV_FILE" @@ -79,6 +79,8 @@ git pull --ff-only origin "$BRANCH" log '安装前台依赖并构建' npm ci --include=dev npm run build +find "$PROJECT_DIR/dist" -type d -exec chmod 755 {} + +find "$PROJECT_DIR/dist" -type f -exec chmod 644 {} + log '安装 CMS 后端生产依赖' ( @@ -91,6 +93,8 @@ log '构建 CMS 管理后台' cd "$PROJECT_DIR/cms/admin" npm ci --include=dev npm run build + find "$PROJECT_DIR/cms/admin/dist" -type d -exec chmod 755 {} + + find "$PROJECT_DIR/cms/admin/dist" -type f -exec chmod 644 {} + ) log '重启 CMS 服务并保存 PM2 进程清单'