From afafbaf509ee4b6e5c78f5cdeb60d6eb3fd85ab9 Mon Sep 17 00:00:00 2001 From: Phil Leggetter Date: Fri, 8 Aug 2025 13:21:44 +0100 Subject: [PATCH] fix: project use should prompt for project selection --- pkg/cmd/project_use.go | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pkg/cmd/project_use.go b/pkg/cmd/project_use.go index d96dd20..829ddc4 100644 --- a/pkg/cmd/project_use.go +++ b/pkg/cmd/project_use.go @@ -5,8 +5,8 @@ import ( "github.com/spf13/cobra" "github.com/hookdeck/hookdeck-cli/pkg/hookdeck" - "github.com/hookdeck/hookdeck-cli/pkg/validators" "github.com/hookdeck/hookdeck-cli/pkg/project" + "github.com/hookdeck/hookdeck-cli/pkg/validators" ) type projectUseCmd struct { @@ -47,14 +47,19 @@ func (lc *projectUseCmd) runProjectUseCmd(cmd *cobra.Command, args []string) err } } + prompt := &survey.Select{ + Message: "Select Project", + Options: projectNames, + } + + if currentProjectName != "" { + prompt.Default = currentProjectName + } + var qs = []*survey.Question{ { - Name: "project_name", - Prompt: &survey.Select{ - Message: "Select Project", - Options: projectNames, - Default: currentProjectName, - }, + Name: "project_name", + Prompt: prompt, Validate: survey.Required, }, }