From 2543e7957137012f78e698c68745b21346e8f211 Mon Sep 17 00:00:00 2001 From: "Mr.Xia" <1424473282@qq.com> Date: Fri, 27 Feb 2026 13:46:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- run.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/run.sh b/run.sh index 4107330..61f7eaa 100644 --- a/run.sh +++ b/run.sh @@ -26,8 +26,16 @@ prepare_standalone() { if [ -f ".next/standalone/server.js" ]; then rm -rf .next/standalone/.next .next/standalone/public mkdir -p .next/standalone/.next - # 复制完整的 .next 目录内容(standalone 服务器需要所有文件) - [ -d .next ] && cp -r .next/* .next/standalone/.next/ + + # 复制 .next 目录内容,排除 standalone 目录本身 + for item in .next/*; do + item_name=$(basename "$item") + if [ "$item_name" != "standalone" ]; then + cp -r "$item" .next/standalone/.next/ + fi + done + + # 复制 public 目录 [ -d public ] && cp -r public .next/standalone/ fi }