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
This commit is contained in:
parent
91e4ba03da
commit
e6e2160614
2 changed files with 9 additions and 1 deletions
5
.changeset/lemon-tools-rescue.md
Normal file
5
.changeset/lemon-tools-rescue.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'create-astro': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixes support for using templates from any GitHub repository
|
|
@ -108,7 +108,10 @@ export async function main() {
|
||||||
|
|
||||||
const hash = args.commit ? `#${args.commit}` : '';
|
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}`, {
|
const emitter = degit(`${templateTarget}${hash}`, {
|
||||||
cache: false,
|
cache: false,
|
||||||
|
|
Loading…
Reference in a new issue