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

Function resolveGitSubdirUrl

src/utils/plugins/pluginLoader.ts:686–693  ·  view source on GitHub ↗

* Resolve a git-subdir `url` field to a clonable git URL. * Accepts GitHub owner/repo shorthand (converted to ssh or https depending on * CLAUDE_CODE_REMOTE) or any URL that passes validateGitUrl (https, http, * file, git@ ssh).

(url: string)

Source from the content-addressed store, hash-verified

684 * file, git@ ssh).
685 */
686function resolveGitSubdirUrl(url: string): string {
687 if (/^[a-zA-Z0-9-_.]+\/[a-zA-Z0-9-_.]+$/.test(url)) {
688 return isEnvTruthy(process.env.CLAUDE_CODE_REMOTE)
689 ? `https://github.com/${url}.git`
690 : `git@github.com:${url}.git`
691 }
692 return validateGitUrl(url)
693}
694
695/**
696 * Install a plugin from a subdirectory of a git repository (exported for

Callers 1

installFromGitSubdirFunction · 0.85

Calls 2

isEnvTruthyFunction · 0.85
validateGitUrlFunction · 0.85

Tested by

no test coverage detected