diff options
author | 2023-09-22 14:18:46 +0100 | |
---|---|---|
committer | 2023-09-22 21:18:46 +0800 | |
commit | b64dd45c0d641f9f2ed997e2cbdf8a6b0193195f (patch) | |
tree | d87d20a7a157983e6118b0f311d809daa0910ae7 /packages/create-astro/src | |
parent | bd00ad776db9d6d3bde323d0ecf8065f186b3a57 (diff) | |
download | astro-b64dd45c0d641f9f2ed997e2cbdf8a6b0193195f.tar.gz astro-b64dd45c0d641f9f2ed997e2cbdf8a6b0193195f.tar.zst astro-b64dd45c0d641f9f2ed997e2cbdf8a6b0193195f.zip |
Fix behaviour regression in create-astro (#8634)
Diffstat (limited to 'packages/create-astro/src')
-rw-r--r-- | packages/create-astro/src/actions/template.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/create-astro/src/actions/template.ts b/packages/create-astro/src/actions/template.ts index 253c9fab1..eaebe2360 100644 --- a/packages/create-astro/src/actions/template.ts +++ b/packages/create-astro/src/actions/template.ts @@ -9,10 +9,11 @@ import { error, info, spinner, title } from '../messages.js'; export async function template( ctx: Pick<Context, 'template' | 'prompt' | 'yes' | 'dryRun' | 'exit'> ) { - if (ctx.yes) { - ctx.template = 'basics'; - await info('tmpl', `Using ${color.reset(ctx.template)}${color.dim(' as project template')}`); - } else if (!ctx.template) { + if (!ctx.template && ctx.yes) ctx.template = 'basics'; + + if (ctx.template) { + await info('tmpl', `Using ${color.reset(ctx.template)}${color.dim(' as project template')}`); + } else { const { template: tmpl } = await ctx.prompt({ name: 'template', type: 'select', @@ -26,8 +27,6 @@ export async function template( ], }); ctx.template = tmpl; - } else { - await info('tmpl', `Using ${color.reset(ctx.template)}${color.dim(' as project template')}`); } if (ctx.dryRun) { |