kaizen-agent 1.19.2 → 1.19.3
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/cli/install.ts +11 -3
- package/package.json +1 -1
package/cli/install.ts
CHANGED
|
@@ -1006,18 +1006,26 @@ async function clearBunxCache() {
|
|
|
1006
1006
|
join(process.env.BUN_INSTALL ?? join(home, ".bun"), "install", "cache"),
|
|
1007
1007
|
join(process.env.XDG_CACHE_HOME ?? join(home, ".cache"), "bun"),
|
|
1008
1008
|
process.env.LOCALAPPDATA ? join(process.env.LOCALAPPDATA, "bun", "install", "cache") : null,
|
|
1009
|
+
// bun's own answer beats guessing: on Linux it is ~/.cache/.bun/install/cache.
|
|
1010
|
+
(await Bun.$`${process.execPath} pm cache`.quiet().nothrow().text()).trim() || null,
|
|
1009
1011
|
].filter((d): d is string => Boolean(d));
|
|
1010
|
-
for (const dir of caches) {
|
|
1012
|
+
for (const dir of new Set(caches)) {
|
|
1011
1013
|
try {
|
|
1012
1014
|
for (const name of readdirSync(dir)) {
|
|
1013
|
-
|
|
1015
|
+
// The manifest is <hash>.npm, named by a hash, with the package name in its
|
|
1016
|
+
// header: a stale one answers "no version matching" for a fresh release.
|
|
1017
|
+
if (name.endsWith(".npm")) {
|
|
1018
|
+
let head = "";
|
|
1019
|
+
try { head = readFileSync(join(dir, name)).subarray(0, 1024).toString("latin1"); } catch {}
|
|
1020
|
+
if (!head.includes("kaizen-agent")) continue;
|
|
1021
|
+
} else if (!name.includes("kaizen-agent")) continue;
|
|
1014
1022
|
rmSync(join(dir, name), { recursive: true, force: true });
|
|
1015
1023
|
removed++;
|
|
1016
1024
|
}
|
|
1017
1025
|
} catch { /* no cache directory is the same as an empty one */ }
|
|
1018
1026
|
}
|
|
1019
1027
|
|
|
1020
|
-
step(removed ? `cleared ${removed} cached copy of the installer` : "no installer cache to clear");
|
|
1028
|
+
step(removed ? `cleared ${removed} cached ${removed === 1 ? "copy" : "copies"} of the installer` : "no installer cache to clear");
|
|
1021
1029
|
}
|
|
1022
1030
|
function tilde(p: string) { return p.startsWith(home) ? "~" + p.slice(home.length) : p; }
|
|
1023
1031
|
|
package/package.json
CHANGED