-
Notifications
You must be signed in to change notification settings - Fork 52
Expand file tree
/
Copy pathdev.cjs
More file actions
39 lines (32 loc) · 764 Bytes
/
Copy pathdev.cjs
File metadata and controls
39 lines (32 loc) · 764 Bytes
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
#!/usr/bin/env node
const { spawn, spawnSync } = require('child_process');
const isWindows = process.platform === 'win32';
// Run cleanup on all platforms
spawnSync('npm', ['run', 'dev:clean'], {
stdio: 'inherit',
shell: isWindows
});
// Use delayed electron on all platforms for consistency
const electronCommand = 'npm run dev:electron:delayed';
const args = [
'-k',
'--kill-others-on-fail',
'-n',
'react,electron',
'-c',
'cyan,magenta',
'npm run dev:react',
electronCommand
];
const proc = spawn('concurrently', args, {
stdio: 'inherit',
shell: isWindows
});
['SIGINT', 'SIGTERM'].forEach((signal) => {
process.on(signal, () => {
proc.kill(signal);
});
});
proc.on('exit', (code) => {
process.exit(code ?? 0);
});