25 lines
821 B
JavaScript
25 lines
821 B
JavaScript
export function createElectronSpawnOptions({ env, colorEnv, expoDevUrl, devBuildLabel }) {
|
|
return {
|
|
// Electron must stay in the runner's process group. Paseo workspace scripts
|
|
// own the terminal process group, so detaching Electron lets it survive a
|
|
// service stop with broken stdout/stderr pipes and block the next launch.
|
|
detached: false,
|
|
env: {
|
|
...env,
|
|
...colorEnv,
|
|
EXPO_DEV_URL: expoDevUrl,
|
|
...(devBuildLabel ? { EXPO_PUBLIC_PASEO_DEV_BUILD_LABEL: devBuildLabel } : {}),
|
|
},
|
|
};
|
|
}
|
|
|
|
export function resolveChildKillTarget(pid, detached) {
|
|
return detached ? -pid : pid;
|
|
}
|
|
|
|
export function registerDevRunnerShutdownSignals({ signalSource, stop }) {
|
|
for (const signal of ["SIGHUP", "SIGINT", "SIGTERM"]) {
|
|
signalSource.on(signal, () => stop("SIGTERM"));
|
|
}
|
|
}
|