Skip to content
Permalink
Browse files

fix(maker): fix renaming of DMG output when a custom name is provided

  • Loading branch information
MarshallOfSound committed May 20, 2017
1 parent 8d895cf commit 14cc927aa95867cc5b1d9816f1c1d65cd86ef4c0
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/makers/darwin/dmg.js
@@ -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.
You can’t perform that action at this time.