diff --git a/console/package.json b/console/package.json index 80c9430..583d0ea 100644 --- a/console/package.json +++ b/console/package.json @@ -16,6 +16,9 @@ "electron": "^38.0.0", "electron-builder": "^26.0.12" }, + "pnpm": { + "onlyBuiltDependencies": ["electron", "electron-winstaller"] + }, "build": { "appId": "top.yeij.scoreboard.console", "productName": "Scoreboard Console", diff --git a/deploy/build.bat b/deploy/build.bat index f0b19c5..9fc0351 100644 --- a/deploy/build.bat +++ b/deploy/build.bat @@ -57,25 +57,24 @@ REM win.icon 由 electron-builder 内部调 rcedit 写进 PE 资源; REM 它需要的 winCodeSign / nsis 从 gh-proxy 取,签名关闭。 taskkill /im "Scoreboard Console.exe" /f >nul 2>&1 taskkill /im scoreboard.exe /f >nul 2>&1 -REM 部署包根目录要带 rules\ 与 使用说明.txt(devdocs 10 §4.4)。 -REM rules\ 由 package.json 的 extraFiles 直接从仓库根拷入; -REM 使用说明.txt 是可选文档,只在 docs\ 下存在时才暂存到 console\extra\, -REM electron-builder 的 extraFiles 会把该目录内容平铺到部署包根目录。 -if not exist "rules" echo 警告:rules\ 不存在,部署包将缺少规则包目录 +REM 部署包根目录要带 rules\ 与使用说明;rules\ 由 package.json 的 extraFiles 拷入。 +REM 注意:cmd 对 UTF-8 中文放进 if(...) 块会解析错乱,所以块内一律用 ASCII, +REM 中文只出现在顶层命令的路径字面量里。 +if not exist "rules" echo [warn] rules\ missing if not exist "console\extra" mkdir "console\extra" if exist "console\extra\使用说明.txt" del /q "console\extra\使用说明.txt" -if exist "docs\使用说明.txt" ( - copy /y "docs\使用说明.txt" "console\extra\使用说明.txt" >nul - echo 使用说明.txt 已加入部署包(来源:docs\使用说明.txt) -) else ( - if exist "docs\使用手册.md" ( - REM 文档目录里只有 Markdown 版手册时,按部署包约定的文件名落盘 - copy /y "docs\使用手册.md" "console\extra\使用说明.txt" >nul - echo 使用说明.txt 已加入部署包(来源:docs\使用手册.md) - ) else ( - echo docs\ 下没有 使用说明.txt / 使用手册.md,跳过(部署包不含使用说明.txt) - ) -) +if exist "docs\使用说明.txt" goto :usage_from_txt +if exist "docs\使用手册.md" goto :usage_from_md +echo [docs] no usage doc, skip +goto :usage_done +:usage_from_txt +copy /y "docs\使用说明.txt" "console\extra\使用说明.txt" >nul +echo usage doc added +goto :usage_done +:usage_from_md +copy /y "docs\使用手册.md" "console\extra\使用说明.txt" >nul +echo usage doc added (from manual) +:usage_done cd console call pnpm install --frozen-lockfile || exit /b 1 call pnpm run dist || exit /b 1