updated ets to kill background processes

This commit is contained in:
Ben Carter
2023-09-11 21:38:23 -04:00
parent 8a260629b5
commit 03c9d6ba31
2 changed files with 21 additions and 29 deletions

View File

@@ -135,39 +135,32 @@ function buildModules(luaDir, moduleDir, watch, liveReload) {
tscwatch.start("--outDir", outputDir);
}
// if (watch && liveReload) {
// log.info(`Starting Eluna watcher... (THIS ONLY WORKS WITH DOCKER CONFIGS!)`);
// const runShellScript = () => {
// const scriptProcess = spawn("./send-reload-eluna.sh");
// scriptProcess.stdout.on("close", (data) => {
// log.success("Reloading Eluna complete..");
// });
// scriptProcess.stderr.on("data", (data) => {
// log.error(`Script Error: ${data}`);
// });
// };
// const rerunEluna = _.debounce(runShellScript, 300);
// fs.watch(outputDir, (eventType, filename) => {
// if (eventType === "change" || eventType === "rename") {
// log.info(`Change detected in ${filename}. \nReloading eluna...`);
// rerunEluna();
// }
// });
// log.success("Starting Eluna watcher...");
// runShellScript();
// }
} catch (error) {
// Clean up any processes that are running.
if(tscwatch) {
tscwatch.stop();
}
if(reloadprocess) {
reloadprocess.kill();
}
log.error(`Error occurred: ${error.message}`);
process.exit(1);
}
// Clean up any processes that are running.
process.on("exit", () => {
if(tscwatch) {
tscwatch.stop();
}
if(reloadprocess) {
reloadprocess.kill();
}
})
return;
}
/**

View File

@@ -11,7 +11,6 @@
if (command == "hello") {
const message = "Hello World command was entered!";
PrintInfo(message);
SendWorldMessage(message);
}
return true;