MCPcopy Create free account
hub / github.com/WJX20/claude-code / removePluginInstallation

Function removePluginInstallation

src/utils/plugins/installedPluginsManager.ts:452–475  ·  view source on GitHub ↗
(
  pluginId: string,
  scope: PersistableScope,
  projectPath?: string,
)

Source from the content-addressed store, hash-verified

450 * @param projectPath - Project path (for project/local scopes)
451 */
452export function removePluginInstallation(
453 pluginId: string,
454 scope: PersistableScope,
455 projectPath?: string,
456): void {
457 const data = loadInstalledPluginsFromDisk()
458 const installations = data.plugins[pluginId]
459
460 if (!installations) {
461 return
462 }
463
464 data.plugins[pluginId] = installations.filter(
465 entry => !(entry.scope === scope && entry.projectPath === projectPath),
466 )
467
468 // Remove plugin entirely if no installations left
469 if (data.plugins[pluginId].length === 0) {
470 delete data.plugins[pluginId]
471 }
472
473 saveInstalledPluginsV2(data)
474 logForDebugging(`Removed installation for ${pluginId} at scope ${scope}`)
475}
476
477// =============================================================================
478// In-Memory vs Disk State Management (for non-in-place updates)

Callers 1

uninstallPluginOpFunction · 0.85

Calls 3

saveInstalledPluginsV2Function · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected