plugins 1.2.10-canary.5 → 1.3.0
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 +17 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -488,6 +488,9 @@ function error(title, details) {
|
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
|
+
function warn(message) {
|
|
492
|
+
barLine(`${c.yellow(S.warning)} ${c.yellow(message)}`);
|
|
493
|
+
}
|
|
491
494
|
async function multiSelect(title, options, maxVisible = 8) {
|
|
492
495
|
if (!process.stdin.isTTY) {
|
|
493
496
|
return options.map((o) => o.value);
|
|
@@ -822,20 +825,27 @@ async function installToPluginCache(plugins, scope, repoPath, source) {
|
|
|
822
825
|
barDebug(c.dim("Updated installed_plugins.json"));
|
|
823
826
|
const settingsPath = join3(home, ".claude", "settings.json");
|
|
824
827
|
let settings = {};
|
|
828
|
+
let settingsCorrupted = false;
|
|
825
829
|
if (existsSync2(settingsPath)) {
|
|
826
830
|
try {
|
|
827
831
|
settings = JSON.parse(await readFile2(settingsPath, "utf-8"));
|
|
828
832
|
} catch {
|
|
833
|
+
settingsCorrupted = true;
|
|
829
834
|
}
|
|
830
835
|
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
836
|
+
if (settingsCorrupted) {
|
|
837
|
+
warn("Could not parse ~/.claude/settings.json \u2014 skipping enabledPlugins update to avoid overwriting existing settings.");
|
|
838
|
+
barLine(c.dim("You may need to manually enable the plugins in Claude Code settings."));
|
|
839
|
+
} else {
|
|
840
|
+
const enabled = settings.enabledPlugins ?? {};
|
|
841
|
+
for (const plugin of plugins) {
|
|
842
|
+
const pluginKey = `${plugin.name}@${marketplaceName}`;
|
|
843
|
+
enabled[pluginKey] = true;
|
|
844
|
+
}
|
|
845
|
+
settings.enabledPlugins = enabled;
|
|
846
|
+
await writeFile(settingsPath, JSON.stringify(settings, null, 2));
|
|
847
|
+
barDebug(c.dim("Updated settings.json enabledPlugins"));
|
|
835
848
|
}
|
|
836
|
-
settings.enabledPlugins = enabled;
|
|
837
|
-
await writeFile(settingsPath, JSON.stringify(settings, null, 2));
|
|
838
|
-
barDebug(c.dim("Updated settings.json enabledPlugins"));
|
|
839
849
|
cachePopulated = true;
|
|
840
850
|
}
|
|
841
851
|
async function installToCursorExtensions(plugins, scope, repoPath, source) {
|