Skip to content

Commit afafbaf

Browse files
committed
fix: project use should prompt for project selection
1 parent 198d9fc commit afafbaf

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

pkg/cmd/project_use.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"github.com/spf13/cobra"
66

77
"github.com/hookdeck/hookdeck-cli/pkg/hookdeck"
8-
"github.com/hookdeck/hookdeck-cli/pkg/validators"
98
"github.com/hookdeck/hookdeck-cli/pkg/project"
9+
"github.com/hookdeck/hookdeck-cli/pkg/validators"
1010
)
1111

1212
type projectUseCmd struct {
@@ -47,14 +47,19 @@ func (lc *projectUseCmd) runProjectUseCmd(cmd *cobra.Command, args []string) err
4747
}
4848
}
4949

50+
prompt := &survey.Select{
51+
Message: "Select Project",
52+
Options: projectNames,
53+
}
54+
55+
if currentProjectName != "" {
56+
prompt.Default = currentProjectName
57+
}
58+
5059
var qs = []*survey.Question{
5160
{
52-
Name: "project_name",
53-
Prompt: &survey.Select{
54-
Message: "Select Project",
55-
Options: projectNames,
56-
Default: currentProjectName,
57-
},
61+
Name: "project_name",
62+
Prompt: prompt,
5863
Validate: survey.Required,
5964
},
6065
}

0 commit comments

Comments
 (0)