* 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, )
| 194 | * seed is configured or none contains a populated directory at this version. |
| 195 | */ |
| 196 | async function probeSeedCache( |
| 197 | pluginId: string, |
| 198 | version: string, |
| 199 | ): Promise<string | null> { |
| 200 | for (const seedDir of getPluginSeedDirs()) { |
| 201 | const seedPath = getVersionedCachePathIn(seedDir, pluginId, version) |
| 202 | try { |
| 203 | const entries = await readdir(seedPath) |
| 204 | if (entries.length > 0) return seedPath |
| 205 | } catch { |
| 206 | // Try next seed |
| 207 | } |
| 208 | } |
| 209 | return null |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * When the computed version is 'unknown', probe seed/cache/<m>/<p>/ for an |
no test coverage detected