* Probe seed directories for a populated cache at this plugin version. * Seeds are checked in precedence order; first hit wins. Returns null if no * seed is configured or none contains a populated directory at this version.
( pluginId: string, version: string, )
| 193 | * seed is configured or none contains a populated directory at this version. |
| 194 | */ |
| 195 | async function probeSeedCache( |
| 196 | pluginId: string, |
| 197 | version: string, |
| 198 | ): Promise<string | null> { |
| 199 | for (const seedDir of getPluginSeedDirs()) { |
| 200 | const seedPath = getVersionedCachePathIn(seedDir, pluginId, version) |
| 201 | try { |
| 202 | const entries = await readdir(seedPath) |
| 203 | if (entries.length > 0) return seedPath |
| 204 | } catch { |
| 205 | // Try next seed |
| 206 | } |
| 207 | } |
| 208 | return null |
| 209 | } |
| 210 | |
| 211 | /** |
| 212 | * When the computed version is 'unknown', probe seed/cache/<m>/<p>/ for an |
no test coverage detected