* 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)
| 684 | * file, git@ ssh). |
| 685 | */ |
| 686 | function 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 |
no test coverage detected