-
Notifications
You must be signed in to change notification settings - Fork 1
/
build-lin.js
44 lines (39 loc) · 1.25 KB
/
build-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
const childprocess = require("child_process");
const stream = require('stream');
const runCommand = async (command, backend_builder) => {
const proc = childprocess.exec(command);
proc.stdout
.pipe(
new stream.Transform({
transform: (b, _, next) =>
next(
null,
b
.toString()
.trim()
.split(/\n+/g)
.map((l) => `[${(backend_builder ? 'Wallet Backend Builder' : 'Electron Builder')}] ${l}`)
.join('\n')
)
})
)
.on('data', (d) => console.error(d.toString()));
proc.stderr
.pipe(
new stream.Transform({
transform: (b, _, next) =>
next(
null,
b
.toString()
.trim()
.split(/\n+/g)
.map((l) => `[${(backend_builder ? 'Wallet Backend Builder' : 'Electron Builder')}] ${l}`)
.join('\n')
)
})
)
.on('data', (d) => console.error(d.toString()));
await new Promise((res) => proc.once('close', (n) => res()));
}
runCommand('./node_modules/.bin/nexe backend-server/index.js -o backend-server/backend-server', true).then(() => runCommand('./node_modules/.bin/electron-builder build --linux'));