diff --git a/packages/maker/dmg/package.json b/packages/maker/dmg/package.json index 3b098b07b4..3ba47003c0 100644 --- a/packages/maker/dmg/package.json +++ b/packages/maker/dmg/package.json @@ -7,6 +7,10 @@ "license": "MIT", "main": "dist/MakerDMG.js", "typings": "dist/MakerDMG.d.ts", + "scripts": { + "test": "yarn test:base test/**/*_spec.ts", + "test:base": "cross-env TS_NODE_FILES=1 mocha --config ../../../.mocharc.js" + }, "devDependencies": { "chai": "^4.3.3", "chai-as-promised": "^7.0.0", diff --git a/packages/maker/dmg/src/MakerDMG.ts b/packages/maker/dmg/src/MakerDMG.ts index 8b75e9eef0..eeb19131c3 100644 --- a/packages/maker/dmg/src/MakerDMG.ts +++ b/packages/maker/dmg/src/MakerDMG.ts @@ -19,12 +19,13 @@ export default class MakerDMG extends MakerBase { makeDir, appName, packageJSON, + targetArch, }: MakerOptions) { // eslint-disable-next-line global-require const electronDMG = require('electron-installer-dmg'); const outPath = path.resolve(makeDir, `${this.config.name || appName}.dmg`); - const forgeDefaultOutPath = path.resolve(makeDir, `${appName}-${packageJSON.version}.dmg`); + const forgeDefaultOutPath = path.resolve(makeDir, `${appName}-${packageJSON.version}-${targetArch}.dmg`); await this.ensureFile(outPath); const dmgConfig = { diff --git a/packages/maker/dmg/test/MakerDMG_spec.ts b/packages/maker/dmg/test/MakerDMG_spec.ts index 1d68a3b021..3885481e23 100644 --- a/packages/maker/dmg/test/MakerDMG_spec.ts +++ b/packages/maker/dmg/test/MakerDMG_spec.ts @@ -67,14 +67,14 @@ describe('MakerDMG', () => { dir, makeDir, appName, targetArch, packageJSON, }); expect(renameStub.callCount).to.equal(1); - expect(renameStub.firstCall.args[1]).to.include('1.2.3'); + expect(renameStub.firstCall.args[1]).to.include(`1.2.3-${targetArch}`); }); it('should rename the DMG file to include the version if no custom name is set', async () => { await (maker.make as any)({ dir, makeDir, appName, targetArch, packageJSON, }); - expect(renameStub.firstCall.args[1]).to.include('1.2.3'); + expect(renameStub.firstCall.args[1]).to.include(`1.2.3-${targetArch}`); }); it('should not attempt to rename the DMG file if a custom name is set', async () => {