新增 build-mac.js,产出 ad-hoc 签名的 .app 与 DMG。只能在 macOS 上 构建:DMG 依赖 hdiutil,且 Apple Silicon 拒绝执行未签名二进制,改名 与改 plist 后必须用 codesign 重签。 按官方 darwin-arm64 运行时的真实结构处理四处易错点:用 ditto 解压以 保留 framework 符号链接、删除重打包后失效的 ElectronAsarIntegrity、 为改名后的 helper 补上 CFBundleExecutable、签名由内向外且单独签 Squirrel 的 ShipIt。 打包版数据目录改为按平台决定:macOS 走 appData,避免写进 DMG 挂载后 只读的 .app 内部并在升级覆盖时丢失书库;Windows 便携版行为不变。 窗口图标在非 Windows 平台改用 PNG。 .gitignore 的 dist 规则补上前导斜杠。此前它同时匹配 icons/dist/, 导致构建与单测依赖的图标从未入库,新克隆的仓库无法构建。
18 lines
387 B
Plaintext
18 lines
387 B
Plaintext
node_modules/
|
|
# 必须锚定到仓库根:不加斜杠会连 icons/dist/ 一起忽略,
|
|
# 而构建脚本和单测都依赖 icons/dist/ 里的图标产物
|
|
/dist/
|
|
*.log
|
|
.DS_Store
|
|
Thumbs.db
|
|
|
|
# 图标工具生成的对照图,仅供肉眼检查,不参与构建
|
|
icons/dist/preview*.png
|
|
|
|
# 调试探测产生的临时快照
|
|
probe*.json
|
|
probe-*.js
|
|
*.tmp.html
|
|
scihub.html
|
|
*-diagnostic.png
|