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