MCPcopy Create free account
hub / github.com/codeaashu/claude-code / hasPendingUpdates

Function hasPendingUpdates

src/utils/plugins/installedPluginsManager.ts:595–618  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

593 * @returns true if any plugin has a different install path on disk vs memory
594 */
595export function hasPendingUpdates(): boolean {
596 const memoryState = getInMemoryInstalledPlugins()
597 const diskState = loadInstalledPluginsFromDisk()
598
599 for (const [pluginId, diskInstallations] of Object.entries(
600 diskState.plugins,
601 )) {
602 const memoryInstallations = memoryState.plugins[pluginId]
603 if (!memoryInstallations) continue
604
605 for (const diskEntry of diskInstallations) {
606 const memoryEntry = memoryInstallations.find(
607 m =>
608 m.scope === diskEntry.scope &&
609 m.projectPath === diskEntry.projectPath,
610 )
611 if (memoryEntry && memoryEntry.installPath !== diskEntry.installPath) {
612 return true // Disk has different version than memory
613 }
614 }
615 }
616
617 return false
618}
619
620/**
621 * Get the count of pending updates (installations where disk differs from memory).

Callers 1

Calls 3

entriesMethod · 0.80

Tested by

no test coverage detected