loadAllModules takes a list of module sources, downloads those modules, and parses their config
(moduleSources []string)
| 82 | |
| 83 | // loadAllModules takes a list of module sources, downloads those modules, and parses their config |
| 84 | func loadAllModules(moduleSources []string) (map[string]moduleconfig.ModuleConfig, map[string]string) { |
| 85 | modules := make(map[string]moduleconfig.ModuleConfig) |
| 86 | mappedSources := make(map[string]string) |
| 87 | |
| 88 | wg := sync.WaitGroup{} |
| 89 | wg.Add(len(moduleSources)) |
| 90 | for _, moduleSource := range moduleSources { |
| 91 | go module.FetchModule(moduleSource, &wg) |
| 92 | } |
| 93 | wg.Wait() |
| 94 | |
| 95 | for _, moduleSource := range moduleSources { |
| 96 | mod, err := module.ParseModuleConfig(moduleSource) |
| 97 | if err != nil { |
| 98 | exit.Fatal("Unable to load module (%s): %v\n", moduleSource, err) |
| 99 | } |
| 100 | modules[mod.Name] = mod |
| 101 | mappedSources[mod.Name] = moduleSource |
| 102 | } |
| 103 | return modules, mappedSources |
| 104 | } |
| 105 | |
| 106 | // Project name is prompt individually because the rest of the prompts |
| 107 | // requires the projectName to populate defaults |
no test coverage detected