summaryrefslogtreecommitdiff
path: root/packages/create-astro/src/index.ts
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@matthewphillips.info> 2021-07-06 15:14:22 -0400
committerGravatar GitHub <noreply@github.com> 2021-07-06 15:14:22 -0400
commitd8ceff5facbbe7d7b358c718e73c2cfaa31cae5a (patch)
tree6d28a563a60853c7b75ad06673597240b2e0aaee /packages/create-astro/src/index.ts
parent2ab625bee86f752ca963a572ee28b93cd94e8643 (diff)
downloadastro-d8ceff5facbbe7d7b358c718e73c2cfaa31cae5a.tar.gz
astro-d8ceff5facbbe7d7b358c718e73c2cfaa31cae5a.tar.zst
astro-d8ceff5facbbe7d7b358c718e73c2cfaa31cae5a.zip
Implements templates from external repos (#603)
* Implements templates from external repos * Adds a changeset
Diffstat (limited to 'packages/create-astro/src/index.ts')
-rw-r--r--packages/create-astro/src/index.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/create-astro/src/index.ts b/packages/create-astro/src/index.ts
index c63cca9ea..e3487e8d4 100644
--- a/packages/create-astro/src/index.ts
+++ b/packages/create-astro/src/index.ts
@@ -55,7 +55,12 @@ export async function main() {
]);
const hash = args.commit ? `#${args.commit}` : '';
- const emitter = degit(`snowpackjs/astro/examples/${options.template}${hash}`, {
+
+ const templateTarget = options.template.includes('/') ?
+ options.template :
+ `snowpackjs/astro/examples/${options.template}`;
+
+ const emitter = degit(`${templateTarget}${hash}`, {
cache: false,
force: true,
verbose: false,