(projectName string, modules map[string]moduleconfig.ModuleConfig)
| 119 | } |
| 120 | |
| 121 | func getProjectPrompts(projectName string, modules map[string]moduleconfig.ModuleConfig) map[string]PromptHandler { |
| 122 | handlers := map[string]PromptHandler{ |
| 123 | "ShouldPushRepositories": { |
| 124 | Parameter: moduleconfig.Parameter{ |
| 125 | Field: "ShouldPushRepositories", |
| 126 | Label: "Should the created projects be checked into github automatically?", |
| 127 | Info: "If yes, we will automatically create repositories for you in github and check in the generated code.\nIf no, you will need to do these steps manually after running the zero create command.", |
| 128 | Options: yaml.MapSlice{ |
| 129 | yaml.MapItem{Key: "y", Value: "yes"}, |
| 130 | yaml.MapItem{Key: "n", Value: "no"}, |
| 131 | }, |
| 132 | }, |
| 133 | Condition: NoCondition, |
| 134 | Validate: SpecificValueValidation("y", "n"), |
| 135 | }, |
| 136 | "GithubRootOrg": { |
| 137 | Parameter: moduleconfig.Parameter{ |
| 138 | Field: "GithubRootOrg", |
| 139 | Label: "What's the root of the github organization that will own these repositories?", |
| 140 | Info: "This should be github.com/<your-organization-name>", |
| 141 | Default: "github.com/", |
| 142 | }, |
| 143 | Condition: NoCondition, |
| 144 | Validate: ValidateOrganizationName, |
| 145 | }, |
| 146 | } |
| 147 | |
| 148 | for moduleName, module := range modules { |
| 149 | label := fmt.Sprintf("What do you want to call the %s project?", moduleName) |
| 150 | |
| 151 | handlers[moduleName] = PromptHandler{ |
| 152 | Parameter: moduleconfig.Parameter{ |
| 153 | Field: moduleName, |
| 154 | Label: label, |
| 155 | Info: "This will be used as the name of the repository.", |
| 156 | Default: module.OutputDir, |
| 157 | }, |
| 158 | Condition: NoCondition, |
| 159 | Validate: NoValidation, |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | return handlers |
| 164 | } |
| 165 | |
| 166 | func chooseCloudProvider(projectConfig *projectconfig.ZeroProjectConfig) { |
| 167 | // @TODO move options into configs |
no test coverage detected