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