SummarizeParameters receives all parameters gathered from prompts during `Zero init` and based on module definition to construct the parameters for each module for zero-project.yml filters out parameters defined as OmitFromProjectFile: true
(module ModuleConfig, allParams map[string]string)
| 234 | // and based on module definition to construct the parameters for each module for zero-project.yml |
| 235 | // filters out parameters defined as OmitFromProjectFile: true |
| 236 | func SummarizeParameters(module ModuleConfig, allParams map[string]string) map[string]string { |
| 237 | moduleParams := make(projectconfig.Parameters) |
| 238 | // Loop through all the prompted values and find the ones relevant to this module |
| 239 | for parameterKey, parameterValue := range allParams { |
| 240 | for _, moduleParameter := range module.Parameters { |
| 241 | if moduleParameter.Field == parameterKey { |
| 242 | if moduleParameter.OmitFromProjectFile { |
| 243 | flog.Debugf("Omitted %s from %s", parameterKey, module.Name) |
| 244 | } else { |
| 245 | moduleParams[parameterKey] = parameterValue |
| 246 | } |
| 247 | } |
| 248 | } |
| 249 | } |
| 250 | return moduleParams |
| 251 | } |
| 252 | |
| 253 | // SummarizeConditions based on conditions from zero-module.yml |
| 254 | // creates and returns slice of conditions for project config |