forked from mike-goodwin/owasp-threat-dragon-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer-lin.js
100 lines (79 loc) · 2.54 KB
/
installer-lin.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// utility to create the linux distro files for OWASP Threat Dragon
module.exports.all = async function () {
// these have to be done consequtively not concurrently,
// otherwise get 'files exist' errors
await debX86()
await debAmd64()
await rpmX86()
await rpmAmd64()
await snapX86()
await snapAmd64()
}
async function createRelease (installer, options) {
try {
await installer(options)
console.log(`** Success, release at ${options.dest}`)
} catch (err) {
console.error("** No dice : " + err.message)
}
}
async function debX86 () {
console.log('** Creating Debian release .deb package for Intel x86 64 bit')
const options = {
arch: 'x86_64',
dest: './installers/linux-x64',
icon: 'cupcakes.icns',
src: './packages/OWASP-Threat-Dragon-linux-x64/',
}
await createRelease(require('electron-installer-debian'), options)
}
async function debAmd64 () {
console.log('** Creating Debian release .deb package for AMD 64 bit')
const options = {
arch: 'amd64',
dest: './installers/linux-x64',
icon: 'cupcakes.icns',
src: './packages/OWASP-Threat-Dragon-linux-x64/',
}
await createRelease(require('electron-installer-debian'), options)
}
async function rpmX86 () {
console.log('** Creating Fedora release .rpm package for Intel x86 64 bit')
const options = {
arch: 'x86_64',
dest: './installers/linux-x64',
icon: 'cupcakes.icns',
src: './packages/OWASP-Threat-Dragon-linux-x64/',
}
await createRelease(require('electron-installer-redhat'), options)
}
async function rpmAmd64 () {
console.log('** Creating Fedora release .rpm package for AMD 64 bit')
const options = {
arch: 'amd64',
dest: './installers/linux-x64',
icon: 'cupcakes.icns',
src: './packages/OWASP-Threat-Dragon-linux-x64/',
}
await createRelease(require('electron-installer-redhat'), options)
}
async function snapX86 () {
console.log('** Creating Snap release .snap package for Intel x86 64 bit')
const options = {
arch: 'x86_64',
dest: __dirname + '/installers/linux-x64',
name: 'threatdragon',
src: __dirname + '/packages/OWASP-Threat-Dragon-linux-x64/',
}
await createRelease(require('electron-installer-snap'), options)
}
async function snapAmd64 () {
console.log('** Creating Snap release .snap package for AMD 64 bit')
const options = {
arch: 'amd64',
dest: __dirname + '/installers/linux-x64',
name: 'threatdragon',
src: __dirname + '/packages/OWASP-Threat-Dragon-linux-x64/',
}
await createRelease(require('electron-installer-snap'), options)
}