Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
29 lines
776 B
JavaScript
29 lines
776 B
JavaScript
import * as NodeChildProcess from "node:child_process";
|
|
import * as NodePath from "node:path";
|
|
|
|
import { desktopDir, resolveElectronLaunchCommand } from "./electron-launcher.mjs";
|
|
|
|
NodeChildProcess.execFileSync(
|
|
process.execPath,
|
|
[NodePath.join(desktopDir, "scripts/build-browser-secret.mjs")],
|
|
{ stdio: "inherit" },
|
|
);
|
|
|
|
const childEnv = { ...process.env };
|
|
delete childEnv.ELECTRON_RUN_AS_NODE;
|
|
|
|
const electronCommand = resolveElectronLaunchCommand(["dist-electron/main.cjs"]);
|
|
const child = NodeChildProcess.spawn(electronCommand.electronPath, electronCommand.args, {
|
|
stdio: "inherit",
|
|
cwd: desktopDir,
|
|
env: childEnv,
|
|
});
|
|
|
|
child.on("exit", (code, signal) => {
|
|
if (signal) {
|
|
process.kill(process.pid, signal);
|
|
return;
|
|
}
|
|
process.exit(code ?? 0);
|
|
});
|