( pluginId: string, )
| 218 | * Seeds are checked in precedence order; first match wins. |
| 219 | */ |
| 220 | export async function probeSeedCacheAnyVersion( |
| 221 | pluginId: string, |
| 222 | ): Promise<string | null> { |
| 223 | for (const seedDir of getPluginSeedDirs()) { |
| 224 | // The parent of the version dir — computed the same way as |
| 225 | // getVersionedCachePathIn, just without the version component. |
| 226 | const pluginDir = dirname(getVersionedCachePathIn(seedDir, pluginId, '_')) |
| 227 | try { |
| 228 | const versions = await readdir(pluginDir) |
| 229 | if (versions.length !== 1) continue |
| 230 | const versionDir = join(pluginDir, versions[0]!) |
| 231 | const entries = await readdir(versionDir) |
| 232 | if (entries.length > 0) return versionDir |
| 233 | } catch { |
| 234 | // Try next seed |
| 235 | } |
| 236 | } |
| 237 | return null |
| 238 | } |
| 239 | |
| 240 | /** |
| 241 | * Get legacy (non-versioned) cache path for a plugin. |
no test coverage detected