All files / makers/darwin dmg.js

100% Statements 5/5
100% Branches 0/0
100% Functions 1/1
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20              1x 1x 1x             1x 1x    
import electronDMG from 'electron-installer-dmg';
import path from 'path';
import pify from 'pify';
 
import { ensureFile } from '../../util/ensure-output';
 
export default async (dir, appName, targetArch, forgeConfig, packageJSON) => { // eslint-disable-line
  const outPath = path.resolve(dir, '../make', `${appName}.dmg`);
  await ensureFile(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);
  return [outPath];
};