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

Function hasPendingUpdates

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

Source from the content-addressed store, hash-verified

597 * @returns true if any plugin has a different install path on disk vs memory
598 */
599export function hasPendingUpdates(): boolean {
600 const memoryState = getInMemoryInstalledPlugins()
601 const diskState = loadInstalledPluginsFromDisk()
602
603 for (const [pluginId, diskInstallations] of Object.entries(
604 diskState.plugins,
605 )) {
606 const memoryInstallations = memoryState.plugins[pluginId]
607 if (!memoryInstallations) continue
608
609 for (const diskEntry of diskInstallations) {
610 const memoryEntry = memoryInstallations.find(
611 m =>
612 m.scope === diskEntry.scope &&
613 m.projectPath === diskEntry.projectPath,
614 )
615 if (memoryEntry && memoryEntry.installPath !== diskEntry.installPath) {
616 return true // Disk has different version than memory
617 }
618 }
619 }
620
621 return false
622}
623
624/**
625 * 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