@plumpslabs/fennec-cli 1.13.7 → 1.13.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +19 -13
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -2091,7 +2091,7 @@ function hexColor(color) {
|
|
|
2091
2091
|
}
|
|
2092
2092
|
var fennecOrange2 = hexColor("#FF6432");
|
|
2093
2093
|
var fennecGold = hexColor("#FFB347");
|
|
2094
|
-
var VERSION = "1.13.
|
|
2094
|
+
var VERSION = "1.13.9";
|
|
2095
2095
|
var cachedBanner = null;
|
|
2096
2096
|
var cachedCompact = null;
|
|
2097
2097
|
function generateBanner() {
|
|
@@ -4241,10 +4241,11 @@ async function killCommand(args2) {
|
|
|
4241
4241
|
const trackedMatch = tracked.find((t) => t.name === rawTarget);
|
|
4242
4242
|
if (trackedMatch) {
|
|
4243
4243
|
if (!isTrackedRunning(trackedMatch)) {
|
|
4244
|
+
removeTrackedByPid(trackedMatch.pid);
|
|
4244
4245
|
console.error(`
|
|
4245
|
-
${pc8.
|
|
4246
|
-
console.error(
|
|
4247
|
-
|
|
4246
|
+
${pc8.green("\u2713")} ${pc8.bold(rawTarget)} ${pc8.dim("removed from tracked apps (was already stopped)")}`);
|
|
4247
|
+
console.error();
|
|
4248
|
+
return;
|
|
4248
4249
|
}
|
|
4249
4250
|
targetPid = trackedMatch.pid;
|
|
4250
4251
|
displayName = `${trackedMatch.name} (PID ${targetPid})`;
|
|
@@ -4288,33 +4289,38 @@ Use ${pc8.cyan(`fennec kill <pid>`)} to kill a system process by its PID.`));
|
|
|
4288
4289
|
}
|
|
4289
4290
|
async function killAll(signal, force) {
|
|
4290
4291
|
const tracked = readTracked();
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
console.error(` ${pc8.dim("No running tracked apps to kill.")}`);
|
|
4292
|
+
if (tracked.length === 0) {
|
|
4293
|
+
console.error(` ${pc8.dim("No tracked apps to kill.")}`);
|
|
4294
4294
|
return;
|
|
4295
4295
|
}
|
|
4296
|
+
const running = tracked.filter((t) => isTrackedRunning(t));
|
|
4297
|
+
const stopped = tracked.filter((t) => !isTrackedRunning(t));
|
|
4296
4298
|
console.error(`
|
|
4297
|
-
${pc8.bold(`Kill ${running.length} tracked app(s)?`)}`);
|
|
4298
|
-
console.error(` ${pc8.dim("
|
|
4299
|
+
${pc8.bold(`Kill ${running.length} running + remove ${stopped.length} stopped tracked app(s)?`)}`);
|
|
4300
|
+
console.error(` ${pc8.dim("Permanently removes every Fennec-tracked app \u2014 other processes are untouched.")}
|
|
4299
4301
|
`);
|
|
4300
4302
|
const confirmed = force || await confirmPrompt(`${pc8.red("Are you sure?")} ${pc8.dim("This cannot be undone")}`, false);
|
|
4301
4303
|
if (!confirmed) {
|
|
4302
4304
|
console.error(` ${pc8.dim("Cancelled.")}`);
|
|
4303
4305
|
return;
|
|
4304
4306
|
}
|
|
4305
|
-
const spinner = createSpinner(`Killing ${running.length} tracked app(s)...`);
|
|
4307
|
+
const spinner = createSpinner(`Killing ${running.length} + removing ${stopped.length} tracked app(s)...`);
|
|
4306
4308
|
let killed = 0, failed = 0;
|
|
4307
4309
|
for (const t of running) {
|
|
4308
4310
|
if (killProcess(t.pid, signal)) {
|
|
4309
4311
|
killed++;
|
|
4310
|
-
removeTrackedByPid(t.pid);
|
|
4311
4312
|
} else {
|
|
4312
4313
|
failed++;
|
|
4313
4314
|
}
|
|
4315
|
+
removeTrackedByPid(t.pid);
|
|
4316
|
+
}
|
|
4317
|
+
for (const t of stopped) {
|
|
4318
|
+
removeTrackedByPid(t.pid);
|
|
4314
4319
|
}
|
|
4315
4320
|
await new Promise((r) => setTimeout(r, 300));
|
|
4316
|
-
|
|
4317
|
-
|
|
4321
|
+
const total = running.length + stopped.length;
|
|
4322
|
+
total > 0 ? spinner.succeed(`${killed} killed, ${stopped.length} stopped entr${stopped.length === 1 ? "y" : "ies"} removed`) : spinner.fail("Failed to kill apps");
|
|
4323
|
+
if (failed > 0) console.error(` ${pc8.yellow(`${failed} running app(s) could not be killed`)}`);
|
|
4318
4324
|
}
|
|
4319
4325
|
|
|
4320
4326
|
// src/commands/stop.ts
|