Updates
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+8
-5
@@ -25,23 +25,26 @@ function killChild(childProcess, port) {
|
||||
if (!childProcess)
|
||||
return false;
|
||||
try {
|
||||
const childProcessPID = childProcess.pid;
|
||||
childProcess.kill();
|
||||
return true;
|
||||
}
|
||||
catch (error) {
|
||||
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), "tcp");
|
||||
}
|
||||
childProcess.kill();
|
||||
return true;
|
||||
}
|
||||
else if (port) {
|
||||
yield (0, kill_port_1.default)(Number(port), "tcp");
|
||||
childProcess.kill();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (error) { }
|
||||
return true;
|
||||
}
|
||||
catch (error) {
|
||||
catch (_err) { }
|
||||
console.log(`${console_colors_1.default.FgRed}Error:${console_colors_1.default.Reset} Child Process couldn't be killed! ${error.message}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
Vendored
+4
-12
@@ -1,14 +1,4 @@
|
||||
/**
|
||||
* # Start the process
|
||||
* @param {object} param0
|
||||
* @param {string} param0.command
|
||||
* @param {string[] | string} param0.preflight
|
||||
* @param {string[] | string} [param0.postflight]
|
||||
* @param {string} param0.redeploy_file
|
||||
* @param {string | number | (string | number)[]} [param0.port] - The port to kill on rebuild
|
||||
* @param {boolean} [param0.first_run] - Whether to run the preflight on first run. Default `false`
|
||||
*/
|
||||
export default function startProcess({ command, preflight, postflight, redeploy_file, port, first_run, debounce, }: {
|
||||
type Param = {
|
||||
command: string;
|
||||
preflight?: string[] | string;
|
||||
postflight?: string[] | string;
|
||||
@@ -16,4 +6,6 @@ export default function startProcess({ command, preflight, postflight, redeploy_
|
||||
port?: string | number | (string | number)[];
|
||||
first_run?: boolean;
|
||||
debounce?: number;
|
||||
}): void;
|
||||
};
|
||||
export default function startProcess({ command, preflight, postflight, redeploy_file, port, first_run, debounce, }: Param): void;
|
||||
export {};
|
||||
|
||||
Vendored
-10
@@ -13,16 +13,6 @@ let childProcess = null;
|
||||
const pTitle = "buncid";
|
||||
process.title = pTitle;
|
||||
let timeout;
|
||||
/**
|
||||
* # Start the process
|
||||
* @param {object} param0
|
||||
* @param {string} param0.command
|
||||
* @param {string[] | string} param0.preflight
|
||||
* @param {string[] | string} [param0.postflight]
|
||||
* @param {string} param0.redeploy_file
|
||||
* @param {string | number | (string | number)[]} [param0.port] - The port to kill on rebuild
|
||||
* @param {boolean} [param0.first_run] - Whether to run the preflight on first run. Default `false`
|
||||
*/
|
||||
function startProcess({ command, preflight, postflight, redeploy_file, port, first_run, debounce, }) {
|
||||
const DEBOUNCE = debounce || 1000;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user