Skip to content

Commit

Permalink
loadAllModules should accept a slice of string
Browse files Browse the repository at this point in the history
  • Loading branch information
thdaraujo committed Jun 10, 2020
1 parent c3d0fa0 commit 945146b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions internal/context/init.go
Expand Up @@ -85,7 +85,7 @@ func Init(outDir string) *projectconfig.ZeroProjectConfig {
}

// loadAllModules takes a list of module sources, downloads those modules, and parses their config
func loadAllModules(moduleSources projectconfig.Modules) map[string]moduleconfig.ModuleConfig {
func loadAllModules(moduleSources []string) map[string]moduleconfig.ModuleConfig {
modules := make(map[string]moduleconfig.ModuleConfig)

wg := sync.WaitGroup{}
Expand Down Expand Up @@ -215,7 +215,7 @@ func (registry Registry) availableLabels() []string {
return labels
}

func chooseStack(registry Registry) projectconfig.Modules {
func chooseStack(registry Registry) []string {
providerPrompt := promptui.Select{
Label: "Pick a stack you'd like to use",
Items: registry.availableLabels(),
Expand All @@ -224,8 +224,14 @@ func chooseStack(registry Registry) projectconfig.Modules {
if err != nil {
exit.Fatal("Prompt failed %v\n", err)
}
return registry[providerResult]

modules := registry[providerResult]
repositories := make([]string, len(modules))

for _, module := range modules {
repositories = append(repositories, module.Files.Repository)
}
return repositories
}

func fillProviderDetails(projectConfig *projectconfig.ZeroProjectConfig, s project.Secrets) {
Expand Down

0 comments on commit 945146b

Please sign in to comment.