From 87cb7636521823c7312c6c2ac523c1ad5fa6a125 Mon Sep 17 00:00:00 2001 From: David Cheung Date: Fri, 19 Mar 2021 18:32:00 -0400 Subject: [PATCH] github push repository prompt to be options --- cmd/init.go | 5 +++++ internal/init/init.go | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cmd/init.go b/cmd/init.go index 07b3f3bb6..b5b4bdbcc 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -27,6 +27,11 @@ var initCmd = &cobra.Command{ if projectConfigErr != nil { exit.Fatal(fmt.Sprintf(" Init failed while creating the zero project config file %s", projectConfigErr.Error())) + } else { + flog.Infof(`:tada: Done - Your project definition file has been initialized with your choices. Please review it, make any required changes and then create your project. +cd %s +cat zero-project.yml +zero create`, projectContext.Name) } }, } diff --git a/internal/init/init.go b/internal/init/init.go index a6bcf227d..a32b7619f 100644 --- a/internal/init/init.go +++ b/internal/init/init.go @@ -13,6 +13,7 @@ import ( "github.com/commitdev/zero/pkg/util/exit" "github.com/commitdev/zero/pkg/util/flog" "github.com/manifoldco/promptui" + "gopkg.in/yaml.v2" ) // Create cloud provider context @@ -114,9 +115,12 @@ func getProjectPrompts(projectName string, modules map[string]moduleconfig.Modul handlers := map[string]PromptHandler{ "ShouldPushRepositories": { Parameter: moduleconfig.Parameter{ - Field: "ShouldPushRepositories", - Label: "Should the created projects be checked into github automatically? (y/n)", - Default: "y", + Field: "ShouldPushRepositories", + Label: "Should the created projects be checked into github automatically?", + Options: yaml.MapSlice{ + yaml.MapItem{Key: "y", Value: "yes"}, + yaml.MapItem{Key: "n", Value: "no"}, + }, }, Condition: NoCondition, Validate: SpecificValueValidation("y", "n"),