From a7ba7c8057e183d4d630eb479125a0ecdceef509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E5=AE=87=E5=AE=81?= Date: Sat, 7 Nov 2026 20:20:51 +0700 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy_prod.sh | 12 +++++++++++- next-env.d.ts | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/deploy_prod.sh b/deploy_prod.sh index 0214647..3536826 100755 --- a/deploy_prod.sh +++ b/deploy_prod.sh @@ -29,7 +29,17 @@ LINUX_DIST="$DIR/dist/production-linux-x64-glibc" [ -d "$LINUX_DIST" ] || fail "构建产物 $LINUX_DIST 不存在" echo "[3/5] 生成 tar.gz 和 SHA-256..." -(cd "$LINUX_DIST" && tar --no-xattrs --exclude='.DS_Store' --exclude='node_modules/@img/sharp-darwin-arm64' --exclude='node_modules/@img/sharp-libvips-darwin-arm64' -czf "$STAGE/$PACKAGE_NAME" --owner=0 --group=0 .) +# 属主统一为 root:GNU tar 用 --owner/--group,macOS 自带 bsdtar 用 --uid/--gid。 +if tar --version 2>/dev/null | grep -q 'GNU tar'; then + TAR_OWNER_FLAGS=(--owner=0 --group=0) +else + TAR_OWNER_FLAGS=(--uid 0 --gid 0) +fi +(cd "$LINUX_DIST" && COPYFILE_DISABLE=1 COPY_EXTENDED_ATTRIBUTES_DISABLE=1 tar --no-xattrs "${TAR_OWNER_FLAGS[@]}" \ + --exclude='.DS_Store' --exclude='._*' \ + --exclude='node_modules/@img/sharp-darwin-arm64' --exclude='node_modules/@img/sharp-libvips-darwin-arm64' \ + -czf "$STAGE/$PACKAGE_NAME" .) +tar -tzf "$STAGE/$PACKAGE_NAME" >/dev/null || fail "压缩包校验失败" (cd "$STAGE" && shasum -a 256 "$PACKAGE_NAME" > "$PACKAGE_NAME.sha256") ls -lh "$STAGE/$PACKAGE_NAME" "$STAGE/$PACKAGE_NAME.sha256" diff --git a/next-env.d.ts b/next-env.d.ts index 6936789..ce4e94a 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,7 +1,7 @@ /// /// -import "./.next-dev/dev/types/routes.d.ts"; -import "./.next-dev/dev/types/root-params.d.ts"; +import "./.next/types/routes.d.ts"; +import "./.next/types/root-params.d.ts"; // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.