@cannbot-ai/install-helper 1.1.6-beta.11 → 1.1.6-beta.12
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 +33 -4
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -4995,7 +4995,7 @@ async function installPlugins(pluginIds, tool, level, repoPath, installPath, yes
|
|
|
4995
4995
|
|
|
4996
4996
|
// src/commands/uninstall.ts
|
|
4997
4997
|
init_registry();
|
|
4998
|
-
import { existsSync as existsSync18, unlinkSync as unlinkSync6, rmdirSync, readdirSync as readdirSync7 } from "fs";
|
|
4998
|
+
import { existsSync as existsSync18, unlinkSync as unlinkSync6, rmdirSync, readdirSync as readdirSync7, readFileSync as readFileSync9 } from "fs";
|
|
4999
4999
|
import { resolve, basename as basename3, sep, join as join18 } from "path";
|
|
5000
5000
|
import chalk11 from "chalk";
|
|
5001
5001
|
import { select as select5, checkbox as checkbox2, Separator as Separator4, confirm as confirm3 } from "@inquirer/prompts";
|
|
@@ -5277,7 +5277,36 @@ async function uninstallPlugins(pluginIds, batchMode) {
|
|
|
5277
5277
|
async function uninstallPluginById(pluginId, batchMode) {
|
|
5278
5278
|
const plugin = findPlugin(pluginId);
|
|
5279
5279
|
if (!plugin) return;
|
|
5280
|
-
|
|
5280
|
+
let record = readRecord(plugin.id);
|
|
5281
|
+
if (!record) {
|
|
5282
|
+
for (const toolName of VALID_TOOLS) {
|
|
5283
|
+
for (const lvl of ["project", "global"]) {
|
|
5284
|
+
const configRoot2 = getConfigRoot(toolName, lvl);
|
|
5285
|
+
const manifestPath = join18(configRoot2, `${pluginId}-manifest.json`);
|
|
5286
|
+
if (!existsSync18(manifestPath)) continue;
|
|
5287
|
+
let manifest = null;
|
|
5288
|
+
try {
|
|
5289
|
+
manifest = JSON.parse(readFileSync9(manifestPath, "utf-8"));
|
|
5290
|
+
} catch {
|
|
5291
|
+
continue;
|
|
5292
|
+
}
|
|
5293
|
+
const installPath = lvl === "project" ? process.cwd() : configRoot2;
|
|
5294
|
+
record = scanInstalledFiles(
|
|
5295
|
+
pluginId,
|
|
5296
|
+
plugin.displayName,
|
|
5297
|
+
toolName,
|
|
5298
|
+
lvl,
|
|
5299
|
+
installPath,
|
|
5300
|
+
configRoot2,
|
|
5301
|
+
manifest,
|
|
5302
|
+
plugin.externalRepos?.map((r) => basename3(r.dir)),
|
|
5303
|
+
plugin.configRootConfigLink
|
|
5304
|
+
);
|
|
5305
|
+
break;
|
|
5306
|
+
}
|
|
5307
|
+
if (record) break;
|
|
5308
|
+
}
|
|
5309
|
+
}
|
|
5281
5310
|
if (!record) {
|
|
5282
5311
|
logger.warn(`${plugin.displayName} ${t("uninstall_no_record")}`);
|
|
5283
5312
|
logger.info(`${t("uninstall_no_record_hint")}`);
|
|
@@ -5569,7 +5598,7 @@ async function langCommand(action, value) {
|
|
|
5569
5598
|
// src/cli.ts
|
|
5570
5599
|
init_config();
|
|
5571
5600
|
init_i18n();
|
|
5572
|
-
import { readFileSync as
|
|
5601
|
+
import { readFileSync as readFileSync10, existsSync as existsSync20 } from "fs";
|
|
5573
5602
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
5574
5603
|
import { dirname as dirname6, join as join20 } from "path";
|
|
5575
5604
|
function readVersion() {
|
|
@@ -5589,7 +5618,7 @@ function readVersion() {
|
|
|
5589
5618
|
];
|
|
5590
5619
|
for (const pkgPath of candidates) {
|
|
5591
5620
|
if (existsSync20(pkgPath)) {
|
|
5592
|
-
const pkg = JSON.parse(
|
|
5621
|
+
const pkg = JSON.parse(readFileSync10(pkgPath, "utf-8"));
|
|
5593
5622
|
if (pkg.version && (pkg.name === "@cannbot-ai/install-helper" || pkg.name?.startsWith("@cannbot-ai/install-helper-"))) {
|
|
5594
5623
|
return pkg.version;
|
|
5595
5624
|
}
|