diff --git a/packages/maker/dmg/package.json b/packages/maker/dmg/package.json index e959781ad6..7528d911cd 100644 --- a/packages/maker/dmg/package.json +++ b/packages/maker/dmg/package.json @@ -23,8 +23,7 @@ "dependencies": { "@electron-forge/maker-base": "6.0.0-beta.29", "@electron-forge/shared-types": "6.0.0-beta.29", - "fs-extra": "^7.0.0", - "pify": "^4.0.0" + "fs-extra": "^7.0.0" }, "optionalDependencies": { "electron-installer-dmg": "^2.0.0" diff --git a/packages/maker/dmg/src/MakerDMG.ts b/packages/maker/dmg/src/MakerDMG.ts index ac20b3dd47..9e45ce001f 100644 --- a/packages/maker/dmg/src/MakerDMG.ts +++ b/packages/maker/dmg/src/MakerDMG.ts @@ -5,7 +5,6 @@ import { MakerDMGConfig } from './Config'; import fs from 'fs-extra'; import path from 'path'; -import pify from 'pify'; export default class MakerDMG extends MakerBase { name = 'dmg'; @@ -24,7 +23,8 @@ export default class MakerDMG extends MakerBase { const electronDMG = require('electron-installer-dmg'); const outPath = path.resolve(makeDir, `${this.config.name || appName}.dmg`); - const wantedOutPath = path.resolve(makeDir, `${appName}-${packageJSON.version}.dmg`); + const forgeDefaultOutPath = path.resolve(makeDir, `${appName}-${packageJSON.version}.dmg`); + await this.ensureFile(outPath); const dmgConfig = Object.assign({ overwrite: true, @@ -33,10 +33,13 @@ export default class MakerDMG extends MakerBase { appPath: path.resolve(dir, `${appName}.app`), out: path.dirname(outPath), }); - await pify(electronDMG)(dmgConfig); + const opts = await electronDMG.p(dmgConfig); if (!this.config.name) { - await fs.rename(outPath, wantedOutPath); + await this.ensureFile(forgeDefaultOutPath); + await fs.rename(outPath, forgeDefaultOutPath); + return [forgeDefaultOutPath]; } - return [wantedOutPath]; + + return [opts.dmgPath]; } }