This commit is contained in:
Benjamin Toby
2025-02-03 13:41:13 +01:00
parent cee4bc0478
commit 619afc8303
29 changed files with 722 additions and 169 deletions
+10 -7
View File
@@ -27,15 +27,18 @@ function killChild(childProcess, port) {
try {
const childProcessPID = childProcess.pid;
childProcess.kill();
if (typeof port == "object" && (port === null || port === void 0 ? void 0 : port[0])) {
for (let i = 0; i < port.length; i++) {
const singlePort = port[i];
yield (0, kill_port_1.default)(Number(singlePort));
try {
if (typeof port == "object" && (port === null || port === void 0 ? void 0 : port[0])) {
for (let i = 0; i < port.length; i++) {
const singlePort = port[i];
yield (0, kill_port_1.default)(Number(singlePort));
}
}
else if (port) {
yield (0, kill_port_1.default)(Number(port));
}
}
else if (port) {
yield (0, kill_port_1.default)(Number(port));
}
catch (error) { }
return true;
}
catch (error) {
+1 -1
View File
@@ -10,7 +10,7 @@
*/
export default function startProcess({ command, preflight, postflight, redeploy_file, port, first_run, }: {
command: string;
preflight: string[] | string;
preflight?: string[] | string;
postflight?: string[] | string;
redeploy_file: string;
port?: string | number | (string | number)[];
+1 -6
View File
@@ -26,11 +26,7 @@ function startProcess({ command, preflight, postflight, redeploy_file, port, fir
try {
if (first_run) {
console.log("First Run ...");
const runPreflight = (0, preflight_1.default)(preflight);
}
if (!preflight) {
console.log(`${console_colors_1.default.FgRed}Error:${console_colors_1.default.Reset} No preflight included in config file. If you don't want to run any preflight command simply add an empty array.`);
process.exit();
const runFirstPreflight = (0, preflight_1.default)(preflight);
}
childProcess = (0, run_1.default)(command);
if (!childProcess) {
@@ -50,7 +46,6 @@ function startProcess({ command, preflight, postflight, redeploy_file, port, fir
try {
const runPreflight = (0, preflight_1.default)(preflight);
if (!runPreflight) {
// TODO: Action to take if preflight fails
console.log(`${console_colors_1.default.FgRed}Error:${console_colors_1.default.Reset} Preflight Failed.`);
}
else {