forked from FreeTubeApp/FreeTube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
53 lines (42 loc) · 1.02 KB
/
build.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
const os = require('os')
const builder = require('electron-builder')
const config = require('./ebuilder.config.js')
const Platform = builder.Platform
const Arch = builder.Arch
const args = process.argv
let targets
const platform = os.platform()
if (platform === 'darwin') {
let arch = Arch.x64
if (args[2] === 'arm64') {
arch = Arch.arm64
}
targets = Platform.MAC.createTarget(['DMG', 'zip', '7z'], arch)
} else if (platform === 'win32') {
let arch = Arch.x64
if (args[2] === 'arm64') {
arch = Arch.arm64
}
targets = Platform.WINDOWS.createTarget(['nsis', 'zip', '7z', 'portable'], arch)
} else if (platform === 'linux') {
let arch = Arch.x64
if (args[2] === 'arm64') {
arch = Arch.arm64
}
if (args[2] === 'arm32') {
arch = Arch.armv7l
}
targets = Platform.LINUX.createTarget(['deb', 'zip', '7z', 'apk', 'rpm', 'AppImage', 'pacman'], arch)
}
builder
.build({
targets,
config,
publish: 'never'
})
.then(m => {
console.log(m)
})
.catch(e => {
console.error(e)
})