修7
Some checks failed
CI / lint (push) Has been cancelled
CI / build (push) Has been cancelled

This commit is contained in:
2026-02-27 13:46:26 +08:00
parent 4e8cf9dcbb
commit 2543e79571

12
run.sh
View File

@@ -26,8 +26,16 @@ prepare_standalone() {
if [ -f ".next/standalone/server.js" ]; then if [ -f ".next/standalone/server.js" ]; then
rm -rf .next/standalone/.next .next/standalone/public rm -rf .next/standalone/.next .next/standalone/public
mkdir -p .next/standalone/.next 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/ [ -d public ] && cp -r public .next/standalone/
fi fi
} }