()
| 623 | * @returns Number of installations with pending updates |
| 624 | */ |
| 625 | export 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. |
nothing calls this directly
no test coverage detected