support cloning subdirectories and branches when parsing Git URLs in meteor create --from

This commit is contained in:
Nacho Codoñer
2026-04-08 13:36:10 +02:00
parent 7231e2f322
commit 9508cf8829

View File

@@ -1183,7 +1183,12 @@ main.registerCommand({
if (example.isInternal) {
await cloneSubdirectory(EXAMPLES_REPO, EXAMPLES_BRANCH, example.internalPath, appPath);
} else {
await cloneRepo(example.repositoryUrl, appPath);
const parsed = parseGitUrl(example.repositoryUrl);
if (parsed.dir) {
await cloneSubdirectory(parsed.repoUrl, parsed.branch, parsed.dir, appPath);
} else {
await cloneRepo(parsed.repoUrl, appPath, { branch: parsed.branch });
}
}
await setupMessages();