( pluginId: string, version?: string, )
| 266 | * @returns Absolute path to plugin directory |
| 267 | */ |
| 268 | export async function resolvePluginPath( |
| 269 | pluginId: string, |
| 270 | version?: string, |
| 271 | ): Promise<string> { |
| 272 | // Try versioned path first |
| 273 | if (version) { |
| 274 | const versionedPath = getVersionedCachePath(pluginId, version) |
| 275 | if (await pathExists(versionedPath)) { |
| 276 | return versionedPath |
| 277 | } |
| 278 | } |
| 279 | |
| 280 | // Fall back to legacy path for existing installations |
| 281 | const pluginName = parsePluginIdentifier(pluginId).name || pluginId |
| 282 | const legacyPath = getLegacyCachePath(pluginName) |
| 283 | if (await pathExists(legacyPath)) { |
| 284 | return legacyPath |
| 285 | } |
| 286 | |
| 287 | // Return versioned path for new installations |
| 288 | return version ? getVersionedCachePath(pluginId, version) : legacyPath |
| 289 | } |
| 290 | |
| 291 | /** |
| 292 | * Recursively copy a directory. |
nothing calls this directly
no test coverage detected