-
Notifications
You must be signed in to change notification settings - Fork 7
/
builder.js
executable file
·67 lines (56 loc) · 1.43 KB
/
builder.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
'use strict';
const builder = require('electron-builder');
const Platform = builder.Platform;
let config, target;
const argTarget = process.argv[2];
switch (argTarget) {
case 'win':
case 'win32':
console.log('Using build configuration to Windows (32-bit).');
target = Platform.WINDOWS.createTarget();
config = {
win: {
target: [
{
target: 'nsis',
arch: 'ia32'
}
]
}
};
break;
case 'win64':
console.log('Using build configuration to Windows (64-bit).');
target = Platform.WINDOWS.createTarget();
config = {
win: {
target: [
{
target: 'nsis',
arch: 'x64'
}
]
}
};
break;
case 'mac':
console.log('Using build configuration to macOS.');
target = Platform.MAC.createTarget();
break;
case 'linux':
console.log('Using build configuration to Linux (64-bit).');
target = Platform.LINUX.createTarget();
break;
default:
console.error('ERROR - Build target not recognised. Accepted targets: win, win32, mac, linux.');
break;
}
builder.build({
targets: target,
config
}).then(function (m) {
console.log('Generated files:');
console.log(m);
}).catch(function (e) {
console.error(e);
});