Updates
This commit is contained in:
+9
-7
@@ -17,14 +17,16 @@ export default async function killChild(
|
||||
const childProcessPID = childProcess.pid;
|
||||
childProcess.kill();
|
||||
|
||||
if (typeof port == "object" && port?.[0]) {
|
||||
for (let i = 0; i < port.length; i++) {
|
||||
const singlePort = port[i];
|
||||
await kill(Number(singlePort));
|
||||
try {
|
||||
if (typeof port == "object" && port?.[0]) {
|
||||
for (let i = 0; i < port.length; i++) {
|
||||
const singlePort = port[i];
|
||||
await kill(Number(singlePort));
|
||||
}
|
||||
} else if (port) {
|
||||
await kill(Number(port));
|
||||
}
|
||||
} else if (port) {
|
||||
await kill(Number(port));
|
||||
}
|
||||
} catch (error) {}
|
||||
|
||||
return true;
|
||||
} catch (error: any) {
|
||||
|
||||
+2
-11
@@ -29,7 +29,7 @@ export default function startProcess({
|
||||
first_run,
|
||||
}: {
|
||||
command: string;
|
||||
preflight: string[] | string;
|
||||
preflight?: string[] | string;
|
||||
postflight?: string[] | string;
|
||||
redeploy_file: string;
|
||||
port?: string | number | (string | number)[];
|
||||
@@ -38,14 +38,7 @@ export default function startProcess({
|
||||
try {
|
||||
if (first_run) {
|
||||
console.log("First Run ...");
|
||||
const runPreflight = preflightFn(preflight);
|
||||
}
|
||||
|
||||
if (!preflight) {
|
||||
console.log(
|
||||
`${colors.FgRed}Error:${colors.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 = preflightFn(preflight);
|
||||
}
|
||||
|
||||
childProcess = run(command);
|
||||
@@ -77,8 +70,6 @@ export default function startProcess({
|
||||
const runPreflight = preflightFn(preflight);
|
||||
|
||||
if (!runPreflight) {
|
||||
// TODO: Action to take if preflight fails
|
||||
|
||||
console.log(
|
||||
`${colors.FgRed}Error:${colors.Reset} Preflight Failed.`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user