Spaces:
Sleeping
Sleeping
Download scripts/dev-full.mjs from build-small-hackathon/6ixPulse: direct link, hf CLI and curl.
- Browser
- Download file 802 Bytes
-
https://huggingface.co/spaces/build-small-hackathon/6ixPulse/resolve/refs%2Fpr%2F2/scripts/dev-full.mjs
- Command line
-
hf download hf://spaces/build-small-hackathon/6ixPulse@refs/pr/2/scripts/dev-full.mjs
-
curl -L -o dev-full.mjs https://huggingface.co/spaces/build-small-hackathon/6ixPulse/resolve/refs%2Fpr%2F2/scripts/dev-full.mjs
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); | |
| }); | |
| } | |