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