Updates
This commit is contained in:
+8
-5
@@ -4,7 +4,6 @@ import colors from "./console-colors";
|
||||
import preflightFn from "./preflight";
|
||||
import run from "./run";
|
||||
import killChild from "./kill-child";
|
||||
import chokidar from "chokidar";
|
||||
|
||||
let childProcess: ChildProcess | null = null;
|
||||
|
||||
@@ -59,9 +58,9 @@ export default function startProcess({
|
||||
|
||||
console.log("Watching", redeploy_file);
|
||||
|
||||
const watcher = chokidar.watch(redeploy_file, { ignoreInitial: true });
|
||||
fs.watchFile(redeploy_file, { interval: 100 }, (curr, prev) => {
|
||||
if (global.DEPLOYING == 1) return;
|
||||
|
||||
watcher.on("change", (path, stats) => {
|
||||
clearTimeout(timeout);
|
||||
|
||||
timeout = setTimeout(() => {
|
||||
@@ -71,6 +70,8 @@ export default function startProcess({
|
||||
return;
|
||||
}
|
||||
|
||||
global.DEPLOYING = 1;
|
||||
|
||||
if (childProcess) {
|
||||
console.log("******************************");
|
||||
console.log(
|
||||
@@ -97,13 +98,13 @@ export default function startProcess({
|
||||
);
|
||||
|
||||
if (!runPostflight) {
|
||||
// TODO: Action to take if postflight fails
|
||||
|
||||
console.log(
|
||||
`${colors.FgRed}Error:${colors.Reset} Postflight Failed.`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
global.DEPLOYING = 0;
|
||||
} else {
|
||||
process.exit();
|
||||
}
|
||||
@@ -115,6 +116,8 @@ export default function startProcess({
|
||||
);
|
||||
process.exit();
|
||||
}
|
||||
} else {
|
||||
global.DEPLOYING = 0;
|
||||
}
|
||||
}, DEBOUNCE);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user