Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(maker-dmg): add the arch to the default dmg name #2431

Merged
merged 1 commit into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/maker/dmg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Comment on lines +10 to +13
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't directly related. I just needed an easy way to run just the DMG maker's tests.

"devDependencies": {
"chai": "^4.3.3",
"chai-as-promised": "^7.0.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/maker/dmg/src/MakerDMG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ export default class MakerDMG extends MakerBase<MakerDMGConfig> {
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 = {
Expand Down
4 changes: 2 additions & 2 deletions packages/maker/dmg/test/MakerDMG_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down