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

Function getPendingUpdateCount

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

entriesMethod · 0.80

Tested by

no test coverage detected