2020-06-01 16:53:51 +02:00
|
|
|
module.exports = function (grunt) {
|
|
|
|
grunt.registerMultiTask('electron-builder', 'Runs electron-builder', function () {
|
2020-03-17 22:46:21 +01:00
|
|
|
const done = this.async();
|
|
|
|
|
|
|
|
const opt = this.options();
|
|
|
|
|
|
|
|
const builder = require('electron-builder');
|
|
|
|
const Platform = builder.Platform;
|
|
|
|
|
|
|
|
builder
|
|
|
|
.build({
|
|
|
|
...opt,
|
|
|
|
targets: Platform[opt.targets.toUpperCase()].createTarget()
|
|
|
|
})
|
|
|
|
.then(done)
|
2020-06-01 16:53:51 +02:00
|
|
|
.catch((error) => {
|
2020-03-17 22:46:21 +01:00
|
|
|
return grunt.warn('electron-builder returned an error: \n' + error);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|