MCPcopy
hub / github.com/codeaashu/claude-code / resolvePluginPath

Function resolvePluginPath

src/utils/plugins/pluginLoader.ts:266–287  ·  view source on GitHub ↗
(
  pluginId: string,
  version?: string,
)

Source from the content-addressed store, hash-verified

264 * @returns Absolute path to plugin directory
265 */
266export 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.

Callers

nothing calls this directly

Calls 4

getVersionedCachePathFunction · 0.85
pathExistsFunction · 0.85
parsePluginIdentifierFunction · 0.85
getLegacyCachePathFunction · 0.85

Tested by

no test coverage detected