Skip to content

Commit c7b4555

Browse files
authored
Fix issue with vite template add resources (#70)
1 parent 37abbf1 commit c7b4555

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

cmd/app/create.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,6 @@ func selectTemplate(cobraCmd *cobra.Command, apiClient *api.Client) (string, con
272272

273273
for _, t := range templatesResp.Templates {
274274
if t.ID == recommendedID {
275-
t.Name = t.Name + " (recommended)"
276275
orderedTemplates = append([]*api.TemplateItem{t}, orderedTemplates...)
277276
} else {
278277
orderedTemplates = append(orderedTemplates, t)
@@ -291,10 +290,14 @@ func selectTemplate(cobraCmd *cobra.Command, apiClient *api.Client) (string, con
291290
return template.TemplateURL, template.Name, template.ID, nil
292291
}
293292

294-
// Create options for the select
293+
// Create options for the select (add display suffix for recommended template)
295294
options := make([]huh.Option[string], len(orderedTemplates))
296295
for i, template := range orderedTemplates {
297-
options[i] = huh.NewOption(string(template.Name), template.TemplateURL)
296+
displayName := string(template.Name)
297+
if template.ID == recommendedID {
298+
displayName += " (recommended)"
299+
}
300+
options[i] = huh.NewOption(displayName, template.TemplateURL)
298301
}
299302

300303
// Prompt user to select a template

0 commit comments

Comments
 (0)