MCPcopy
hub / github.com/EveryInc/compound-engineering-plugin / resolvePluginPath

Function resolvePluginPath

src/commands/install.ts:234–253  ·  view source on GitHub ↗
(input: string, branch?: string)

Source from the content-addressed store, hash-verified

232}
233
234async function resolvePluginPath(input: string, branch?: string): Promise<ResolvedPluginPath> {
235 // Only treat as a local path if it explicitly looks like one
236 if (input.startsWith(".") || input.startsWith("/") || input.startsWith("~")) {
237 const expanded = expandHome(input)
238 const directPath = path.resolve(expanded)
239 if (await pathExists(directPath)) return { path: directPath }
240 throw new Error(`Local plugin path not found: ${directPath}`)
241 }
242
243 // Skip bundled plugins when a branch is specified — the user wants a specific remote version
244 if (!branch) {
245 const bundledPluginPath = await resolveBundledPluginPath(input)
246 if (bundledPluginPath) {
247 return { path: bundledPluginPath }
248 }
249 }
250
251 // Otherwise, fetch from GitHub (optionally from a specific branch)
252 return await resolveGitHubPluginPath(input, branch)
253}
254
255function parseExtraTargets(value: unknown): string[] {
256 if (!value) return []

Callers 1

runFunction · 0.85

Calls 4

expandHomeFunction · 0.90
pathExistsFunction · 0.90
resolveBundledPluginPathFunction · 0.85
resolveGitHubPluginPathFunction · 0.85

Tested by

no test coverage detected