MCPcopy Index your code
hub / github.com/commitdev/zero / promptAllModules

Function promptAllModules

internal/init/prompts.go:304–315  ·  view source on GitHub ↗

promptAllModules takes a map of all the modules and prompts the user for values for all the parameters Important: This is done here because in this step we share the parameter across modules, meaning if module A and B both asks for region, it will reuse the response for both (and is deduped during r

(modules map[string]moduleconfig.ModuleConfig, projectConfig *projectconfig.ZeroProjectConfig)

Source from the content-addressed store, hash-verified

302// Important: This is done here because in this step we share the parameter across modules,
303// meaning if module A and B both asks for region, it will reuse the response for both (and is deduped during runtime)
304func promptAllModules(modules map[string]moduleconfig.ModuleConfig, projectConfig *projectconfig.ZeroProjectConfig) map[string]string {
305 parameterValues := availableProjectContext(projectConfig)
306 for _, config := range modules {
307 var err error
308
309 parameterValues, err = PromptModuleParams(config, parameterValues)
310 if err != nil {
311 exit.Fatal("Exiting prompt(%s): %v\n", config.Name, err)
312 }
313 }
314 return parameterValues
315}
316
317// availableProjectContext declares a list of variables usable in modules parameter prompt's execute step
318func availableProjectContext(projectConfig *projectconfig.ZeroProjectConfig) map[string]string {

Callers 1

InitFunction · 0.85

Calls 3

FatalFunction · 0.92
availableProjectContextFunction · 0.85
PromptModuleParamsFunction · 0.85

Tested by

no test coverage detected