Skip to content

Commit

Permalink
fix(maker): fix renaming of DMG output when a custom name is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed May 23, 2017
1 parent 8d895cf commit 14cc927
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/makers/darwin/dmg.js
Expand Up @@ -12,17 +12,21 @@ 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}.dmg`);
const userConfig = configFn(forgeConfig.electronInstallerDMG, targetArch);

const outPath = path.resolve(dir, '../make', `${userConfig.name || appName}.dmg`);
const wantedOutPath = path.resolve(dir, '../make', `${appName}-${packageJSON.version}.dmg`);
await ensureFile(outPath);
const dmgConfig = Object.assign({
overwrite: true,
name: appName,
}, configFn(forgeConfig.electronInstallerDMG, targetArch), {
}, userConfig, {
appPath: path.resolve(dir, `${appName}.app`),
out: path.dirname(outPath),
});
await pify(electronDMG)(dmgConfig);
await fs.rename(outPath, wantedOutPath);
if (!userConfig.name) {
await fs.rename(outPath, wantedOutPath);
}
return [wantedOutPath];
};

0 comments on commit 14cc927

Please sign in to comment.