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

Function resolvePluginRoot

src/commands/install.ts:305–322  ·  view source on GitHub ↗
(repoRoot: string, pluginName: string)

Source from the content-addressed store, hash-verified

303}
304
305async function resolvePluginRoot(repoRoot: string, pluginName: string): Promise<string | null> {
306 const rootManifest = path.join(repoRoot, ".claude-plugin", "plugin.json")
307 if (await pathExists(rootManifest)) {
308 try {
309 const raw = await fs.readFile(rootManifest, "utf8")
310 const manifest = JSON.parse(raw) as { name?: string }
311 if (manifest.name === pluginName) return repoRoot
312 } catch {
313 // Fall through to the legacy multi-plugin layout.
314 }
315 }
316
317 const legacyPluginPath = path.join(repoRoot, "plugins", pluginName)
318 const legacyManifest = path.join(legacyPluginPath, ".claude-plugin", "plugin.json")
319 if (await pathExists(legacyManifest)) return legacyPluginPath
320
321 return null
322}
323
324function resolveGitHubSource(): string {
325 const override = process.env.COMPOUND_PLUGIN_GITHUB_SOURCE

Callers 2

resolveBundledPluginPathFunction · 0.70
resolveGitHubPluginPathFunction · 0.70

Calls 1

pathExistsFunction · 0.90

Tested by

no test coverage detected