MCPcopy Create free account
hub / github.com/freecodexyz/free-code / getPendingUpdateCount

Function getPendingUpdateCount

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

Source from the content-addressed store, hash-verified

623 * @returns Number of installations with pending updates
624 */
625export function getPendingUpdateCount(): number {
626 let count = 0
627 const memoryState = getInMemoryInstalledPlugins()
628 const diskState = loadInstalledPluginsFromDisk()
629
630 for (const [pluginId, diskInstallations] of Object.entries(
631 diskState.plugins,
632 )) {
633 const memoryInstallations = memoryState.plugins[pluginId]
634 if (!memoryInstallations) continue
635
636 for (const diskEntry of diskInstallations) {
637 const memoryEntry = memoryInstallations.find(
638 m =>
639 m.scope === diskEntry.scope &&
640 m.projectPath === diskEntry.projectPath,
641 )
642 if (memoryEntry && memoryEntry.installPath !== diskEntry.installPath) {
643 count++
644 }
645 }
646 }
647
648 return count
649}
650
651/**
652 * Get details about pending updates for display.

Callers

nothing calls this directly

Calls 3

entriesMethod · 0.80

Tested by

no test coverage detected