Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds back create-astro support for GitHub repos #3971

Merged
merged 3 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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