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

Function resolveGitHubPluginPath

src/commands/install.ts:281–303  ·  view source on GitHub ↗
(pluginName: string, branch?: string)

Source from the content-addressed store, hash-verified

279}
280
281async function resolveGitHubPluginPath(pluginName: string, branch?: string): Promise<ResolvedPluginPath> {
282 const tempRoot = await fs.mkdtemp(path.join(os.tmpdir(), "compound-plugin-"))
283 const source = resolveGitHubSource()
284 try {
285 await cloneGitHubRepo(source, tempRoot, branch)
286 } catch (error) {
287 await fs.rm(tempRoot, { recursive: true, force: true })
288 throw error
289 }
290
291 const pluginPath = await resolvePluginRoot(tempRoot, pluginName)
292 if (!pluginPath) {
293 await fs.rm(tempRoot, { recursive: true, force: true })
294 throw new Error(`Could not find plugin ${pluginName} in ${source}.`)
295 }
296
297 return {
298 path: pluginPath,
299 cleanup: async () => {
300 await fs.rm(tempRoot, { recursive: true, force: true })
301 },
302 }
303}
304
305async function resolvePluginRoot(repoRoot: string, pluginName: string): Promise<string | null> {
306 const rootManifest = path.join(repoRoot, ".claude-plugin", "plugin.json")

Callers 1

resolvePluginPathFunction · 0.85

Calls 3

cloneGitHubRepoFunction · 0.85
resolveGitHubSourceFunction · 0.70
resolvePluginRootFunction · 0.70

Tested by

no test coverage detected