Skip to content
Permalink
Browse files

fix(maker): fix dmg output path and add test to enforce in future

  • Loading branch information
MarshallOfSound committed May 3, 2017
1 parent 2dffd3c commit a41d6db3fbcb1aebde8d42f8513de7f5205d26f8
Showing with 11 additions and 3 deletions.
  1. +5 −2 src/makers/darwin/dmg.js
  2. +6 −1 test/slow/api_spec_slow.js
@@ -1,3 +1,4 @@
import fs from 'fs-promise';
import path from 'path';
import pify from 'pify';

@@ -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,
@@ -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];
};
@@ -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 () => {

0 comments on commit a41d6db

Please sign in to comment.
You can’t perform that action at this time.