Skip to content

Commit 945146b

Browse files
committed
loadAllModules should accept a slice of string
1 parent c3d0fa0 commit 945146b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

internal/context/init.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func Init(outDir string) *projectconfig.ZeroProjectConfig {
8585
}
8686

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

9191
wg := sync.WaitGroup{}
@@ -215,7 +215,7 @@ func (registry Registry) availableLabels() []string {
215215
return labels
216216
}
217217

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

228+
modules := registry[providerResult]
229+
repositories := make([]string, len(modules))
230+
231+
for _, module := range modules {
232+
repositories = append(repositories, module.Files.Repository)
233+
}
234+
return repositories
229235
}
230236

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

0 commit comments

Comments
 (0)