播放页引导下载添加
This commit is contained in:
+4
-1
@@ -28,7 +28,10 @@ echo "[2/5] 打包 standalone..."
|
||||
echo "[3/5] 生成 tar.gz 和 SHA-256..."
|
||||
# 从 dist/production/ 下进入打 tar,避免外层目录名出现在压缩包里;up_next_h5_prod.sh 预期入口在根(start.mjs 等)。
|
||||
# node_modules 不打进包,远端 npm ci --omit=dev 自己装 Linux 原生依赖;--no-xattrs 去 macOS 扩展属性噪音。
|
||||
(cd "$DIR/dist/production" && tar --no-xattrs --exclude='./node_modules' --exclude='.DS_Store' -czf "$STAGE/$PACKAGE_NAME" --owner=0 --group=0 .)
|
||||
# 属主统一为 root:GNU tar 用 --owner/--group,macOS 自带的 bsdtar 用 --uid/--gid/--uname/--gname;COPYFILE_DISABLE 防止打入 ._* 文件。
|
||||
if tar --version 2>/dev/null | grep -q 'GNU tar'; then OWNER_FLAGS='--owner=0 --group=0'; else OWNER_FLAGS='--uid 0 --gid 0 --uname root --gname root'; fi
|
||||
# shellcheck disable=SC2086 # OWNER_FLAGS 需要按空格拆成多个参数
|
||||
(cd "$DIR/dist/production" && COPYFILE_DISABLE=1 tar --no-xattrs --exclude='./node_modules' --exclude='.DS_Store' $OWNER_FLAGS -czf "$STAGE/$PACKAGE_NAME" .)
|
||||
(cd "$STAGE" && shasum -a 256 "$PACKAGE_NAME" > "$PACKAGE_NAME.sha256")
|
||||
ls -lh "$STAGE/$PACKAGE_NAME" "$STAGE/$PACKAGE_NAME.sha256"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user