Disable mac dmg update info generation

This commit is contained in:
ILoveBingLu
2026-04-08 18:42:25 +08:00
parent 081f4f50fc
commit a485d73a18
2 changed files with 12 additions and 22 deletions
+12
View File
@@ -142,10 +142,22 @@ function getAsarUnpack(buildTarget) {
return baseAsarUnpack
}
function getDmg(buildTarget) {
if (buildTarget === 'mac') {
return {
...(base.dmg || {}),
writeUpdateInfo: false
}
}
return base.dmg
}
module.exports = {
...base,
files: getFiles(target),
asarUnpack: getAsarUnpack(target),
dmg: getDmg(target),
extraResources: getExtraResources(target),
extraFiles: getExtraFiles(target)
}
-22
View File
@@ -13,26 +13,6 @@ if (!target || !['win', 'mac'].includes(target)) {
const cliPath = require.resolve('electron-builder/cli.js')
const configPath = path.join(__dirname, 'electron-builder.config.cjs')
function cleanupBlockmapFiles(buildTarget) {
if (buildTarget !== 'mac') {
return
}
const releaseDir = path.join(__dirname, '..', 'release')
if (!fs.existsSync(releaseDir)) {
return
}
for (const name of fs.readdirSync(releaseDir)) {
if (!name.endsWith('.dmg.blockmap')) {
continue
}
fs.rmSync(path.join(releaseDir, name), { force: true })
console.log(`🧹 Removed obsolete blockmap: ${name}`)
}
}
const result = spawnSync(
process.execPath,
[cliPath, `--${target}`, '--publish', 'never', '--config', configPath],
@@ -53,5 +33,3 @@ const artifactName = target === 'mac'
if (!fs.existsSync(path.join(__dirname, '..', artifactName))) {
process.exit(result.status || 1)
}
cleanupBlockmapFiles(target)