mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 22:55:48 +01:00
fix: template name order
This commit is contained in:
parent
0ad0c4151a
commit
0c042acd4a
1 changed files with 8 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/leaanthony/slicer"
|
||||
|
|
@ -184,15 +185,19 @@ func (po *ProjectOptions) PromptForInputs() error {
|
|||
po.selectedTemplate = templateDetails[po.Template]
|
||||
} else {
|
||||
|
||||
for _, templateDetail := range templateDetails {
|
||||
keys := make([]string, 0)
|
||||
for k := range templateDetails {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
for _, k := range keys {
|
||||
templateDetail := templateDetails[k]
|
||||
templateList.Add(templateDetail)
|
||||
options.Add(fmt.Sprintf("%s - %s", templateDetail.Metadata.Name, templateDetail.Metadata.ShortDescription))
|
||||
}
|
||||
|
||||
templateIndex := 0
|
||||
|
||||
options.Sort()
|
||||
|
||||
if len(options.AsSlice()) > 1 {
|
||||
templateIndex = PromptSelection("Please select a template", options.AsSlice(), 0)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue