Bugfix in spawn file
This commit is contained in:
Vendored
+7
-2
@@ -1,6 +1,7 @@
|
||||
import { Command } from "commander";
|
||||
import path from "path";
|
||||
import writeErrorFile from "../../functions/write-error-file";
|
||||
import { existsSync } from "fs";
|
||||
let retries = 0;
|
||||
let timeout;
|
||||
const MAX_RETRIES = 5;
|
||||
@@ -17,9 +18,13 @@ async function start() {
|
||||
console.error(`Production server crashed ${MAX_RETRIES} times. Exiting.`);
|
||||
process.exit(1);
|
||||
}
|
||||
const dev_spawn_file = path.resolve(__dirname, "prod-spawn.ts");
|
||||
const prod_spawn_file = path.resolve(__dirname, "prod-spawn.ts");
|
||||
const prod_spawn_js_file = path.resolve(__dirname, "prod-spawn.js");
|
||||
const final_spawn_file = existsSync(prod_spawn_js_file)
|
||||
? prod_spawn_js_file
|
||||
: prod_spawn_file;
|
||||
const spawn_options = {
|
||||
cmd: ["bun", dev_spawn_file],
|
||||
cmd: ["bun", final_spawn_file],
|
||||
stdio: ["inherit", "inherit", "inherit"],
|
||||
onExit(subprocess, exitCode, signalCode, error) {
|
||||
writeErrorFile({ exitCode, error });
|
||||
|
||||
Reference in New Issue
Block a user