()
| 597 | * @returns true if any plugin has a different install path on disk vs memory |
| 598 | */ |
| 599 | export 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). |
no test coverage detected