Mailspring/build/tasks/create-mac-dmg.js
Evan Morikawa 3614f1e2f2 feat(build): build DMG
Summary:
We need people to manually drag into their /Applications folders due to
OSX gatekeeper protections.

Test Plan: manual

Reviewers: juan, khamidou

Reviewed By: khamidou

Differential Revision: https://phab.nylas.com/D3756
2017-01-20 12:01:07 -08:00

26 lines
876 B
JavaScript

const path = require('path');
const createDMG = require('electron-installer-dmg')
module.exports = (grunt) => {
grunt.registerTask('create-mac-dmg', 'Create DMG for Nylas Mail', function pack() {
const done = this.async();
const dmgPath = path.join(grunt.config('outputDir'), "NylasMail.dmg");
createDMG({
appPath: path.join(grunt.config('outputDir'), "Nylas Mail-darwin-x64", "Nylas Mail.app"),
name: "NylasMail",
background: path.resolve(grunt.config('appDir'), 'build', 'resources', 'mac', 'Nylas-Mail-DMG-background.png'),
icon: path.resolve(grunt.config('appDir'), 'build', 'resources', 'mac', 'nylas.icns'),
overwrite: true,
out: grunt.config('outputDir'),
}, (err) => {
if (err) {
done(err);
return
}
grunt.log.writeln(`>> Created ${dmgPath}`);
done(null);
})
});
};