Skip to content

Commit 84029fd

Browse files
committed
revert: keep the language prompt to match flags
1 parent 40aee42 commit 84029fd

3 files changed

Lines changed: 4 additions & 11 deletions

File tree

cmd/project/create_samples.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ func promptSampleSelection(ctx context.Context, clients *shared.ClientFactory, s
4848
}
4949
}
5050
languagePrompt := "Select a language:"
51-
if clients.Config.WithExperimentOn(experiment.Templates) {
52-
languagePrompt = "Select a framework:"
53-
}
5451
selection, err := clients.IO.SelectPrompt(ctx, languagePrompt,
5552
languageOptions,
5653
iostreams.SelectPromptConfig{

cmd/project/create_template.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,7 @@ func getSelectionOptions(clients *shared.ClientFactory, categoryID string) []pro
117117
return templatePromptObjects[categoryID]
118118
}
119119

120-
// getFrameworkOptions returns the framework choices for a given template
121-
// selection.
122-
//
123-
// The order of entries should match the unfolded selection order for sake of
124-
// new entries. This is not an implementation requirement.
120+
// getFrameworkOptions returns the framework choices for a given template.
125121
func getFrameworkOptions(template string) []promptObject {
126122
frameworkPromptObjects := map[string][]promptObject{
127123
"slack-cli#ai-apps/support-agent": {
@@ -254,7 +250,7 @@ func promptTemplateSelection(cmd *cobra.Command, clients *shared.ClientFactory,
254250
if categoryID == "slack-cli#ai-apps" {
255251
prompt = "Select a template:"
256252
} else {
257-
prompt = "Select a framework:"
253+
prompt = "Select a language:"
258254
}
259255
}
260256
options := getSelectionOptions(clients, categoryID)
@@ -286,7 +282,7 @@ func promptTemplateSelection(cmd *cobra.Command, clients *shared.ClientFactory,
286282
for i, opt := range examples {
287283
choices[i] = opt.Title
288284
}
289-
choice, err := clients.IO.SelectPrompt(ctx, "Select a framework:", choices, iostreams.SelectPromptConfig{
285+
choice, err := clients.IO.SelectPrompt(ctx, "Select a language:", choices, iostreams.SelectPromptConfig{
290286
Description: func(value string, index int) string {
291287
return examples[index].Description
292288
},

cmd/project/create_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func TestCreateCommand(t *testing.T) {
188188
Return(iostreams.SelectPromptResponse{Prompt: true, Index: 1}, nil)
189189
cm.IO.On("SelectPrompt", mock.Anything, "Select a template:", mock.Anything, mock.Anything).
190190
Return(iostreams.SelectPromptResponse{Prompt: true, Index: 0}, nil)
191-
cm.IO.On("SelectPrompt", mock.Anything, "Select a framework:", mock.Anything, mock.Anything).
191+
cm.IO.On("SelectPrompt", mock.Anything, "Select a language:", mock.Anything, mock.Anything).
192192
Return(iostreams.SelectPromptResponse{Prompt: true, Index: 2}, nil)
193193
createClientMock = new(CreateClientMock)
194194
createClientMock.On("Create", mock.Anything, mock.Anything, mock.Anything).Return("", nil)

0 commit comments

Comments
 (0)