()
| 43 | } |
| 44 | |
| 45 | async function startElectronProcess() { |
| 46 | const electronBinary = await ensureElectronBinary() |
| 47 | |
| 48 | const child = spawn(electronBinary, [entryFile], { |
| 49 | cwd: projectRoot, |
| 50 | stdio: 'inherit', |
| 51 | env: { |
| 52 | ...process.env, |
| 53 | HOWCODE_REPO_ROOT: projectRoot, |
| 54 | HOWCODE_DEV_VIEWPORT: getRequestedViewport() ?? '', |
| 55 | }, |
| 56 | }) |
| 57 | |
| 58 | electronProcess = child |
| 59 | |
| 60 | child.on('exit', () => { |
| 61 | if (electronProcess === child) { |
| 62 | electronProcess = null |
| 63 | } |
| 64 | }) |
| 65 | } |
| 66 | |
| 67 | function stopElectronProcess() { |
| 68 | if (!electronProcess) { |
no test coverage detected