From 7f7ad0b2d10e6c8e2bc26d0d28dd75a5acaaa41b Mon Sep 17 00:00:00 2001 From: lockiechen Date: Mon, 21 Oct 2024 11:11:13 +0800 Subject: [PATCH 1/3] fix: Prevent conflict between parallel makers #3519 --- packages/maker/dmg/src/MakerDMG.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/maker/dmg/src/MakerDMG.ts b/packages/maker/dmg/src/MakerDMG.ts index 46778d38cb..57d9b69fac 100644 --- a/packages/maker/dmg/src/MakerDMG.ts +++ b/packages/maker/dmg/src/MakerDMG.ts @@ -17,15 +17,15 @@ export default class MakerDMG extends MakerBase { async make({ dir, makeDir, appName, packageJSON, targetArch }: MakerOptions): Promise { const { createDMG } = require('electron-installer-dmg'); - - const outPath = path.resolve(makeDir, `${this.config.name || appName}.dmg`); + const dmgName = `${this.config.name || appName}_${targetArch}.dmg` + const outPath = path.resolve(makeDir, dmgName); const forgeDefaultOutPath = path.resolve(makeDir, `${appName}-${packageJSON.version}-${targetArch}.dmg`); await this.ensureFile(outPath); const dmgConfig = { overwrite: true, - name: appName, ...this.config, + name: dmgName, appPath: path.resolve(dir, `${appName}.app`), out: path.dirname(outPath), }; From 3983c73b37714df28541ec7165ad371a56265a83 Mon Sep 17 00:00:00 2001 From: lockiechen Date: Mon, 21 Oct 2024 12:48:36 +0800 Subject: [PATCH 2/3] fix: Prevent conflict between parallel makers #3519 --- packages/maker/dmg/src/MakerDMG.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/maker/dmg/src/MakerDMG.ts b/packages/maker/dmg/src/MakerDMG.ts index 57d9b69fac..6bb11e6c47 100644 --- a/packages/maker/dmg/src/MakerDMG.ts +++ b/packages/maker/dmg/src/MakerDMG.ts @@ -17,8 +17,8 @@ export default class MakerDMG extends MakerBase { async make({ dir, makeDir, appName, packageJSON, targetArch }: MakerOptions): Promise { const { createDMG } = require('electron-installer-dmg'); - const dmgName = `${this.config.name || appName}_${targetArch}.dmg` - const outPath = path.resolve(makeDir, dmgName); + const dmgName = `${this.config.name || appName}_${targetArch}`; + const outPath = path.resolve(makeDir, `${dmgName}.dmg`); const forgeDefaultOutPath = path.resolve(makeDir, `${appName}-${packageJSON.version}-${targetArch}.dmg`); await this.ensureFile(outPath); From b15aef2d58ddcc0f1f24ce97f24cb7544966a9cc Mon Sep 17 00:00:00 2001 From: lockiechen Date: Mon, 21 Oct 2024 12:56:06 +0800 Subject: [PATCH 3/3] fix: Prevent conflict between parallel makers #3519 --- packages/maker/dmg/test/MakerDMG_spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/maker/dmg/test/MakerDMG_spec.ts b/packages/maker/dmg/test/MakerDMG_spec.ts index 704d6fe51a..9d8045c027 100644 --- a/packages/maker/dmg/test/MakerDMG_spec.ts +++ b/packages/maker/dmg/test/MakerDMG_spec.ts @@ -67,7 +67,7 @@ describe('MakerDMG', () => { const opts = eidStub.firstCall.args[0]; expect(opts).to.deep.equal({ overwrite: true, - name: appName, + name: `${appName}_${targetArch}`, appPath: path.resolve(`${dir}/My Test App.app`), out: path.resolve(`${dir.substr(0, dir.length - 4)}/make`), });