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