-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildSharedLibraries.js
43 lines (40 loc) · 980 Bytes
/
buildSharedLibraries.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 { spawn } = require('child_process')
const handleProcess = (child) => {
return new Promise((resolve, reject) => {
child.on('exit', (status) => {
if (status != null && status !== 0) {
reject()
} else if (status != null) {
resolve()
}
})
child.on('error', reject)
})
}
const spawnShell = (commandString) => {
const spawnedProcess = spawn(commandString, {shell: true, detached: true})
spawnedProcess.stdout.pipe(process.stdout)
spawnedProcess.stderr.pipe(process.stderr)
return handleProcess(spawnedProcess)
};
spawnShell(`
cd add-driver/self-service
yarn run build
`).then(() => {
Promise.all([
spawnShell(`
cd add-driver/add-driver-form
yarn run build
`),
spawnShell(`
cd add-driver/self-service-stubs
yarn run build
`),
spawnShell(`
cd add-driver/self-service-remote
yarn run build
`),
]).then(() => {
console.log('Finished building shared libraries')
})
});