forked from bleenco/bterm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.js
43 lines (40 loc) · 1.14 KB
/
package.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const path = require('path');
const builder = require('electron-builder');
const fs = require('fs');
const chalk = require('chalk');
const platform = builder.Platform;
let start = new Date();
let pkgJson = JSON.parse(fs.readFileSync(path.resolve(__dirname, 'package.json')));
builder.build({
config: {
appId: pkgJson.name,
directories: {
buildResources: path.resolve(__dirname, 'node_modules'),
app: path.resolve(__dirname, 'build'),
output: path.resolve(__dirname, 'dist'),
},
compression: 'normal',
extraResources: [],
mac: {
icon: path.resolve(__dirname, 'assets/icon.icns')
},
dmg: {
icon: path.resolve(__dirname, 'assets/icon.icns')
},
nsis: {
installerIcon: path.resolve(__dirname, 'assets/icon.ico'),
installerHeaderIcon: path.resolve(__dirname, 'assets/icon.ico')
},
win: {
icon: path.resolve(__dirname, 'assets/icon.ico'),
},
linux: {
target: 'deb'
}
}
})
.then(() => {
let time = new Date().getTime() - start.getTime();
console.log(`${chalk.green('✔')} Packaging successful in ${time}ms`);
})
.catch(err => console.error(err));