fix(build): build-linux.sh 自己重新生成随包说明书,不再把旧文档打进包
踩过一次:Linux 包内「升级说明.txt」停在 dev_0.5.2,而源码已经走到 0.5.11。 根因是脚本只 **拷** console/extra/*.txt(那些是 deploy/prepare-extra.mjs 的产物), 自己从不重新生成 —— 于是把「上一次生成时的旧说明书」原样打进了包。 (Windows 侧不受影响:build.bat 里有这一步,所以那边一直是新的。) 现在脚本在摆随包文件之前先跑一次 node deploy/prepare-extra.mjs; 生成失败**不阻断**构建(Linux 包不该因为说明书而失败),但打印一行警告, 避免以后又静默发一份旧文档出去。 已验证:重跑脚本后,包内「升级说明.txt」的最新节是 ## dev_0.5.11。
This commit is contained in:
1 parent
48208f395b
commit
7a64e83ecf
1 file changed
+9
-2
@@ -105,8 +105,15 @@ cp -a "$ROOT/console/config.json" "$STAGE/config.json"
|
||||
cp -a "$ROOT/console/scoreboard.png" "$STAGE/scoreboard.png"
|
||||
cp -a "$ROOT/rules" "$STAGE/rules"
|
||||
# 说明书之类平铺在包根(extraFiles 的 from: extra, to: .)。
|
||||
# 这些 .txt 是 deploy/prepare-extra.mjs 从 docs/ 生成到 console/extra/ 的,本脚本不重新生成,
|
||||
# 只负责把它们放进包里;没有就跳过(Linux 包不该因为没有说明书而构建失败)。
|
||||
# ⚠️ 这些 .txt 由 deploy/prepare-extra.mjs 从 docs/ 生成,**必须在这里现场重新生成一次**:
|
||||
# 只拷现成的,包里就会带上"上一次生成时的旧说明书"——已经踩过一次:
|
||||
# 包内「升级说明.txt」停在 dev_0.5.2,而源码已经走到 0.5.11。
|
||||
# 生成失败**不阻断**构建(Linux 包不该因为说明书而失败),但打印一行警告,别静默发旧文档。
|
||||
if [ -f "$ROOT/deploy/prepare-extra.mjs" ] && command -v node >/dev/null 2>&1; then
|
||||
if ! (cd "$ROOT" && node deploy/prepare-extra.mjs >/dev/null 2>&1); then
|
||||
echo " ⚠️ 随包说明书重新生成失败(node deploy/prepare-extra.mjs),包里可能仍是旧版" >&2
|
||||
fi
|
||||
fi
|
||||
if [ -d "$ROOT/console/extra" ]; then
|
||||
find "$ROOT/console/extra" -maxdepth 1 -type f ! -name '.gitkeep' -exec cp -a {} "$STAGE/" \;
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user