()
| 593 | * @returns true if any plugin has a different install path on disk vs memory |
| 594 | */ |
| 595 | export function hasPendingUpdates(): boolean { |
| 596 | const memoryState = getInMemoryInstalledPlugins() |
| 597 | const diskState = loadInstalledPluginsFromDisk() |
| 598 | |
| 599 | for (const [pluginId, diskInstallations] of Object.entries( |
| 600 | diskState.plugins, |
| 601 | )) { |
| 602 | const memoryInstallations = memoryState.plugins[pluginId] |
| 603 | if (!memoryInstallations) continue |
| 604 | |
| 605 | for (const diskEntry of diskInstallations) { |
| 606 | const memoryEntry = memoryInstallations.find( |
| 607 | m => |
| 608 | m.scope === diskEntry.scope && |
| 609 | m.projectPath === diskEntry.projectPath, |
| 610 | ) |
| 611 | if (memoryEntry && memoryEntry.installPath !== diskEntry.installPath) { |
| 612 | return true // Disk has different version than memory |
| 613 | } |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | return false |
| 618 | } |
| 619 | |
| 620 | /** |
| 621 | * Get the count of pending updates (installations where disk differs from memory). |
no test coverage detected