Skip to content

Commit f808fce

Browse files
authored
fix: exit if user cancel template selection (#3)
1 parent 3e7a300 commit f808fce

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/cli.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,16 +179,16 @@ const mainCommand = defineCommand({
179179

180180
// Prompt the user which template to use
181181
if (!args.template) {
182-
args.template = await consola.prompt(
183-
`What template would you like to use?`,
184-
{
182+
args.template = await consola
183+
.prompt(`What template would you like to use?`, {
185184
type: "select",
186185
options: TEMPLATES.map((t) => ({
187186
value: t.name,
188187
label: t.description,
189188
})),
190-
},
191-
);
189+
cancel: "reject",
190+
})
191+
.catch(() => process.exit(1));
192192
}
193193

194194
// Download the template

0 commit comments

Comments
 (0)