Skip to content

Commit e6e2160

Browse files
author
Tony Sullivan
authored
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
1 parent 91e4ba0 commit e6e2160

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

.changeset/lemon-tools-rescue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'create-astro': patch
3+
---
4+
5+
Fixes support for using templates from any GitHub repository

packages/create-astro/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ export async function main() {
108108

109109
const hash = args.commit ? `#${args.commit}` : '';
110110

111-
const templateTarget = `withastro/astro/examples/${options.template}#latest`;
111+
// Don't touch the template name if a GitHub repo was provided, ex: `--template cassidoo/shopify-react-astro`
112+
const templateTarget = options.template.includes('/')
113+
? options.template
114+
: `withastro/astro/examples/${options.template}#latest`;
112115

113116
const emitter = degit(`${templateTarget}${hash}`, {
114117
cache: false,

0 commit comments

Comments
 (0)