Skip to content

Commit

Permalink
Adds back create-astro support for GitHub repos (#3971)
Browse files Browse the repository at this point in the history
* adding create-astro support for GitHub repos

* chore: add changeset

* nit: adding a comment to document what the fix is doing
  • Loading branch information
Tony Sullivan committed Jul 19, 2022
1 parent 91e4ba0 commit e6e2160
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lemon-tools-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-astro': patch
---

Fixes support for using templates from any GitHub repository
5 changes: 4 additions & 1 deletion packages/create-astro/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e6e2160

Please sign in to comment.