6ixPulse / scripts /dev-full.mjs
OwnPath's picture
6ixPulse: clean agentic Space with full dimension scoring (OSM, Toronto Police, TTC/GO, CMHC)
202b514 verified
Raw
History Blame Contribute Delete
802 Bytes
import { spawn } from "node:child_process";
const children = [
spawn(process.execPath, ["server/index.mjs"], {
stdio: "inherit",
env: process.env,
}),
spawn(process.platform === "win32" ? "npm.cmd" : "npm", ["run", "dev"], {
stdio: "inherit",
env: process.env,
}),
];
let shuttingDown = false;
for (const child of children) {
child.on("exit", (code) => {
if (shuttingDown) return;
shuttingDown = true;
for (const other of children) {
if (other !== child && !other.killed) other.kill("SIGTERM");
}
process.exit(code ?? 0);
});
}
for (const signal of ["SIGINT", "SIGTERM"]) {
process.on(signal, () => {
shuttingDown = true;
for (const child of children) {
if (!child.killed) child.kill(signal);
}
process.exit(0);
});
}