19 lines
426 B
TypeScript
19 lines
426 B
TypeScript
import { startStudio } from "./studio.ts";
|
|
|
|
const studio = await startStudio();
|
|
const site = Bun.spawn([process.execPath, "dist/server.js"], {
|
|
stdout: "inherit",
|
|
stderr: "inherit",
|
|
stdin: "inherit",
|
|
env: process.env,
|
|
});
|
|
const stop = () => {
|
|
studio.stop(true);
|
|
site.kill("SIGTERM");
|
|
};
|
|
process.on("SIGINT", stop);
|
|
process.on("SIGTERM", stop);
|
|
const code = await site.exited;
|
|
studio.stop(true);
|
|
process.exit(code);
|