GitHub Pages / build (push) Canceled after 0s
GitHub Pages / deploy (push) Canceled after 0s
Docker image / meta (push) Successful in 24s
Docs Docker image / meta (push) Successful in 7s
Docker image / build (amd64, linux/amd64, ubuntu-latest) (push) Failing after 59s
Docs Docker image / build (amd64, linux/amd64, ubuntu-latest) (push) Failing after 30s
Docker image / merge (push) Canceled after 0s
Docs Docker image / merge (push) Canceled after 0s
Docker image / build (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Docs Docker image / build (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
import { spawn } from "node:child_process";
|
|
import { fileURLToPath } from "node:url";
|
|
import path from "node:path";
|
|
|
|
const scriptsDir = path.dirname(fileURLToPath(import.meta.url));
|
|
const projectRoot = path.resolve(scriptsDir, "..");
|
|
const npmCommand = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
|
|
const processes = [
|
|
spawn(npmCommand, ["run", "dev"], { cwd: path.join(projectRoot, "web"), stdio: "inherit" }),
|
|
spawn(npmCommand, ["run", "dev:linux", "--", "--force"], { cwd: path.join(projectRoot, "admin"), stdio: "inherit" }),
|
|
];
|
|
|
|
let stopping = false;
|
|
|
|
function stopAll(exitCode = 0) {
|
|
if (stopping) return;
|
|
stopping = true;
|
|
for (const child of processes) {
|
|
if (!child.killed) child.kill("SIGTERM");
|
|
}
|
|
setTimeout(() => process.exit(exitCode), 100);
|
|
}
|
|
|
|
for (const child of processes) {
|
|
child.on("exit", (code, signal) => {
|
|
if (stopping) return;
|
|
const exitCode = typeof code === "number" && code !== 0 ? code : signal ? 1 : 0;
|
|
stopAll(exitCode);
|
|
});
|
|
}
|
|
|
|
process.on("SIGINT", () => stopAll(0));
|
|
process.on("SIGTERM", () => stopAll(0));
|