fix(build): build.bat 全 ASCII + Node 脚本处理中文路径 + pnpm-workspace.yaml 构建脚本白名单
This commit is contained in:
1 parent
de4bd63594
commit
1399bae59e
4 files changed
+40
-45
No files matched your search
@@ -0,0 +1,19 @@
|
||||
// 把 docs/ 下的使用说明暂存到 console/extra/,供 electron-builder 的 extraFiles
|
||||
// 平铺到部署包根目录。用 Node 而不是批处理,是因为中文文件名在 .bat 里会被 cmd 解析错乱。
|
||||
import { copyFileSync, existsSync, mkdirSync } from 'node:fs'
|
||||
import { dirname, join } from 'node:path'
|
||||
|
||||
const root = dirname(import.meta.dirname)
|
||||
const extraDir = join(root, 'console', 'extra')
|
||||
const target = join(extraDir, '使用说明.txt')
|
||||
const candidates = [join(root, 'docs', '使用说明.txt'), join(root, 'docs', '使用手册.md')]
|
||||
|
||||
mkdirSync(extraDir, { recursive: true })
|
||||
|
||||
const source = candidates.find((file) => existsSync(file))
|
||||
if (!source) {
|
||||
console.log(' [docs] no usage doc, skip')
|
||||
process.exit(0)
|
||||
}
|
||||
copyFileSync(source, target)
|
||||
console.log(` usage doc staged from ${source}`)
|
||||
Reference in new issue
Block a user