()
| 332 | writeState(state); |
| 333 | |
| 334 | const shutdown = async () => { |
| 335 | await teardown(); |
| 336 | if (state.servePorts) { |
| 337 | const ts = await findTailscale(); |
| 338 | if (ts) { |
| 339 | for (const port of state.servePorts) await sh(ts, ["serve", `--https=${port}`, "off"]); |
| 340 | } |
| 341 | } |
| 342 | rmSync(statePath(target), { force: true }); |
| 343 | process.exit(0); |
| 344 | }; |
| 345 | process.on("SIGTERM", () => void shutdown()); |
| 346 | process.on("SIGINT", () => void shutdown()); |
| 347 | // Stay alive: this process owns the instance (and cloud's emulators). |
no test coverage detected