MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / resolveGitSubdirUrl

Function resolveGitSubdirUrl

src/utils/plugins/pluginLoader.ts:687–694  ·  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

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

Callers 1

installFromGitSubdirFunction · 0.85

Calls 2

validateGitUrlFunction · 0.85
isEnvTruthyFunction · 0.50

Tested by

no test coverage detected