Skip to content

Commit 825fb33

Browse files
authored
Merge pull request #141 from hookdeck/fix/project-use-default
fix: project use should prompt for project selection
2 parents 6994c51 + d710a6c commit 825fb33

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

pkg/cmd/project_use.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,22 @@ func (lc *projectUseCmd) runProjectUseCmd(cmd *cobra.Command, args []string) err
5959
}
6060
}
6161

62+
prompt := &survey.Select{
63+
Message: "Select Project",
64+
Options: projectDisplayNames,
65+
}
66+
67+
if currentProjectName != "" {
68+
prompt.Default = currentProjectName
69+
}
70+
6271
answers := struct {
6372
SelectedFullName string `survey:"selected_full_name"`
6473
}{}
6574
qs := []*survey.Question{
6675
{
67-
Name: "selected_full_name",
68-
Prompt: &survey.Select{
69-
Message: "Select Project",
70-
Options: projectDisplayNames,
71-
Default: currentProjectName,
72-
},
76+
Name: "selected_full_name",
77+
Prompt: prompt,
7378
Validate: survey.Required,
7479
},
7580
}

0 commit comments

Comments
 (0)