Skip to content
Permalink
Browse files

feat(maker): add the dmg maker for the darwin target

  • Loading branch information
MarshallOfSound committed Dec 4, 2016
1 parent f21a87a commit aaceb3f285c77bfc221e8bdbf6db7ecbfdb6a4d8
Showing with 25 additions and 1 deletion.
  1. +1 −0 package.json
  2. +22 −0 src/makers/darwin/dmg.js
  3. +1 −0 src/util/forge-config.js
  4. +1 −1 test/cli_spec.js
@@ -58,6 +58,7 @@
"colors": "^1.1.2",
"commander": "^2.9.0",
"debug": "^2.3.3",
"electron-installer-dmg": "^0.1.2",
"electron-packager": "^8.3.0",
"electron-winstaller": "^2.5.0",
"fs-promise": "^0.5.0",
@@ -0,0 +1,22 @@
import electronDMG from 'electron-installer-dmg';
import fs from 'fs-promise';
import mkdirp from 'mkdirp';
import path from 'path';
import pify from 'pify';
import rimraf from 'rimraf';

export default async (dir, appName, forgeConfig) => {
const outPath = path.resolve(dir, '../make', `${path.basename(dir)}.dmg`);
if (await fs.exists(outPath)) {
await pify(rimraf)(outPath);
}
await pify(mkdirp)(path.dirname(outPath));
const dmgConfig = Object.assign({
overwrite: true,
}, forgeConfig.electronInstallerDMG, {
appPath: path.resolve(dir, `${appName}.app`),
name: appName,
out: path.dirname(outPath),
});
await pify(electronDMG)(dmgConfig);
};
@@ -8,6 +8,7 @@ export default async (dir) => {
electronPackagerConfig: {},
electronWinstallerConfig: {},
electronInstallerDebian: {},
electronInstallerDMG: {},
electronInstallerRedhat: {},
}, forgeConfig);
forgeConfig.make_targets = Object.assign({
@@ -67,7 +67,7 @@ describe(`electron-forge CLI (with installer=${installer.substr(12)})`, () => {
let dir;

before(async () => {
dir = path.resolve(os.tmpdir(), `electron-forge-test-${Date.now()}`);
dir = path.resolve(os.tmpdir(), `electron-forge-test-${`${Date.now()}`.substr(7)}`);
await pSpawn(['init', dir]);
await pSpawn(['package', dir]);
});

0 comments on commit aaceb3f

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