Skip to content

Commit

Permalink
fix(maker): fix dmg output path and add test to enforce in future
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed May 3, 2017
1 parent 2dffd3c commit a41d6db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/makers/darwin/dmg.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import fs from 'fs-promise';
import path from 'path';
import pify from 'pify';

Expand All @@ -11,7 +12,8 @@ export const isSupportedOnCurrentPlatform = async () => process.platform === 'da
export default async ({ dir, appName, targetArch, forgeConfig, packageJSON }) => {
const electronDMG = require('electron-installer-dmg');

const outPath = path.resolve(dir, '../make', `${appName}-${packageJSON.version}.dmg`);
const outPath = path.resolve(dir, '../make', `${appName}.dmg`);
const wantedOutPath = path.resolve(dir, '../make', `${appName}-${packageJSON.version}.dmg`);
await ensureFile(outPath);
const dmgConfig = Object.assign({
overwrite: true,
Expand All @@ -21,5 +23,6 @@ export default async ({ dir, appName, targetArch, forgeConfig, packageJSON }) =>
out: path.dirname(outPath),
});
await pify(electronDMG)(dmgConfig);
return [outPath];
await fs.rename(outPath, wantedOutPath);
return [wantedOutPath];
};
7 changes: 6 additions & 1 deletion test/slow/api_spec_slow.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,12 @@ describe(`electron-forge API (with installer=${installer.substr(12)})`, () => {
for (const optionsFetcher of options) {
if (shouldPass) {
it(`successfully makes for config: ${JSON.stringify(optionsFetcher(), 2)}`, async () => {
await forge.make(optionsFetcher());
const outputs = await forge.make(optionsFetcher());
for (const outputArr of outputs) {
for (const output of outputArr) {
expect(await fs.exists(output)).to.equal(true);
}
}
});
} else {
it(`fails for config: ${JSON.stringify(optionsFetcher(), 2)}`, async () => {
Expand Down

0 comments on commit a41d6db

Please sign in to comment.