Skip to content

Commit 40cc108

Browse files
authored
github push repository prompt to be options (#353)
1 parent 0977af9 commit 40cc108

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

cmd/init.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ var initCmd = &cobra.Command{
2727

2828
if projectConfigErr != nil {
2929
exit.Fatal(fmt.Sprintf(" Init failed while creating the zero project config file %s", projectConfigErr.Error()))
30+
} else {
31+
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.
32+
cd %s
33+
cat zero-project.yml
34+
zero create`, projectContext.Name)
3035
}
3136
},
3237
}

internal/init/init.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"github.com/commitdev/zero/pkg/util/exit"
1414
"github.com/commitdev/zero/pkg/util/flog"
1515
"github.com/manifoldco/promptui"
16+
"gopkg.in/yaml.v2"
1617
)
1718

1819
// Create cloud provider context
@@ -114,9 +115,12 @@ func getProjectPrompts(projectName string, modules map[string]moduleconfig.Modul
114115
handlers := map[string]PromptHandler{
115116
"ShouldPushRepositories": {
116117
Parameter: moduleconfig.Parameter{
117-
Field: "ShouldPushRepositories",
118-
Label: "Should the created projects be checked into github automatically? (y/n)",
119-
Default: "y",
118+
Field: "ShouldPushRepositories",
119+
Label: "Should the created projects be checked into github automatically?",
120+
Options: yaml.MapSlice{
121+
yaml.MapItem{Key: "y", Value: "yes"},
122+
yaml.MapItem{Key: "n", Value: "no"},
123+
},
120124
},
121125
Condition: NoCondition,
122126
Validate: SpecificValueValidation("y", "n"),

0 commit comments

Comments
 (0)