Skip to content

Commit 28767cb

Browse files
authored
Merge pull request #569 from DefangLabs/edw-update-lang-match-sample
Update the sample language to match the sample langurate tags
2 parents 5613dab + eda9e8d commit 28767cb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/cmd/cli/command/commands.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,8 @@ var generateCmd = &cobra.Command{
445445
if sample == "" {
446446
if err := survey.AskOne(&survey.Select{
447447
Message: "Choose the language you'd like to use:",
448-
Options: []string{"Nodejs", "Golang", "Python"},
449-
Default: "Nodejs",
448+
Options: []string{"JavaScript", "Go", "Python"},
449+
Default: "JavaScript",
450450
Help: "The project code will be in the language you choose here.",
451451
}, &language); err != nil {
452452
return err
@@ -461,7 +461,11 @@ var generateCmd = &cobra.Command{
461461
sampleNames := []string{generateWithAI}
462462
sampleDescriptions := []string{"Generate a sample from scratch using a language prompt"}
463463
for _, sample := range sampleList {
464-
if slices.Contains(sample.Languages, lang) {
464+
sampleLangs := make([]string, len(sample.Languages))
465+
for _, l := range sample.Languages {
466+
sampleLangs = append(sampleLangs, strings.ToLower(l))
467+
}
468+
if slices.Contains(sampleLangs, lang) {
465469
sampleNames = append(sampleNames, sample.Name)
466470
sampleDescriptions = append(sampleDescriptions, sample.ShortDescription)
467471
}

0 commit comments

Comments
 (0)