diff options
author | 2022-07-19 14:24:19 +0000 | |
---|---|---|
committer | 2022-07-19 14:24:19 +0000 | |
commit | e6e2160614c9af320419a599c42211d0147760f4 (patch) | |
tree | 889caceecf8611762d823c70e479402af18519df | |
parent | 91e4ba03da51d018a597399ca861c52ed315b818 (diff) | |
download | astro-e6e2160614c9af320419a599c42211d0147760f4.tar.gz astro-e6e2160614c9af320419a599c42211d0147760f4.tar.zst astro-e6e2160614c9af320419a599c42211d0147760f4.zip |
Adds back `create-astro` support for GitHub repos (#3971)
* adding create-astro support for GitHub repos
* chore: add changeset
* nit: adding a comment to document what the fix is doing
-rw-r--r-- | .changeset/lemon-tools-rescue.md | 5 | ||||
-rw-r--r-- | packages/create-astro/src/index.ts | 5 |
2 files changed, 9 insertions, 1 deletions
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, |