forked from cylc/cylc-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
concurrently.cjs
41 lines (38 loc) · 901 Bytes
/
concurrently.cjs
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
/* eslint-disable no-console */
const concurrently = require('concurrently')
const args = process.argv.slice(2)
const { VITE_OPTIONS } = process.env
const allCommands = {
'serve:jupyterhub': {
command: 'yarn run serve:jupyterhub',
name: 'SERVER',
prefixColor: 'yellow'
},
'serve:vue': {
command: `yarn run serve:vue ${VITE_OPTIONS ?? ''}`,
name: 'VITE',
prefixColor: 'blue'
},
preview: {
command: `yarn run -B vite preview --mode offline ${VITE_OPTIONS ?? ''}`,
name: 'VITE',
prefixColor: 'blue'
},
'e2e:open': {
command: 'yarn run -B cypress open --e2e',
name: 'TESTS',
prefixColor: 'magenta'
},
'cy:run': {
command: 'yarn run -B cypress run',
name: 'TESTS',
prefixColor: 'cyan'
}
}
concurrently(
args.map((arg) => allCommands[arg]),
{
successCondition: 'first',
killOthers: ['success', 'failure'],
}
)