Updates
This commit is contained in:
+1
-3
@@ -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
@@ -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("******************************");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user