This commit is contained in:
Benjamin Toby
2025-01-22 12:31:32 +01:00
parent 1c26586478
commit cee4bc0478
9 changed files with 21 additions and 14 deletions
+1 -3
View File
@@ -1,8 +1,6 @@
import { spawn, ChildProcess } from "child_process";
import colors from "./console-colors";
let redeployments = 0;
const KILL_SIGNAL: NodeJS.Signals | number = "SIGTERM";
/**
@@ -31,7 +29,7 @@ export default function run(command: string): ChildProcess | null {
killSignal: KILL_SIGNAL,
});
redeployments++;
global.REDEPLOYMENTS = global.REDEPLOYMENTS + 1;
return newChildProcess;
} catch (error: any) {
+4 -4
View File
@@ -5,8 +5,6 @@ import preflightFn from "./preflight";
import run from "./run";
import killChild from "./kill-child";
let redeployments = 0;
let childProcess: ChildProcess | null = null;
const pTitle = "buncid";
@@ -64,12 +62,14 @@ export default function startProcess({
fs.watchFile(redeploy_file, { interval: 100 }, (curr, prev) => {
console.log(`${colors.BgBlue}File Changed${colors.Reset}`);
if (redeployments == 0) return;
if (global.REDEPLOYMENTS == 0) {
return;
}
if (childProcess) {
console.log("******************************");
console.log(
`******** ${colors.FgBlue}Rebuilding ${colors.FgMagenta}${redeployments}${colors.Reset} ********`
`******** ${colors.FgBlue}Rebuilding ${colors.FgMagenta}${global.REDEPLOYMENTS}${colors.Reset} ********`
);
console.log("******************************");