diff --git a/.changeset/lemon-tools-rescue.md b/.changeset/lemon-tools-rescue.md new file mode 100644 index 000000000..2d8044b61 --- /dev/null +++ b/.changeset/lemon-tools-rescue.md @@ -0,0 +1,5 @@ +--- +'create-astro': patch +--- + +Fixes support for using templates from any GitHub repository diff --git a/packages/create-astro/src/index.ts b/packages/create-astro/src/index.ts index 839877ab6..be6c6a6b9 100644 --- a/packages/create-astro/src/index.ts +++ b/packages/create-astro/src/index.ts @@ -108,7 +108,10 @@ export async function main() { const hash = args.commit ? `#${args.commit}` : ''; - const templateTarget = `withastro/astro/examples/${options.template}#latest`; + // Don't touch the template name if a GitHub repo was provided, ex: `--template cassidoo/shopify-react-astro` + const templateTarget = options.template.includes('/') + ? options.template + : `withastro/astro/examples/${options.template}#latest`; const emitter = degit(`${templateTarget}${hash}`, { cache: false,