Skip to content

Commit

Permalink
Changed pluralization
Browse files Browse the repository at this point in the history
  • Loading branch information
bmonkman committed Jun 5, 2020
1 parent 2c6897f commit ab95383
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 6 additions & 8 deletions internal/context/init.go
Expand Up @@ -45,15 +45,14 @@ func Init(projectName string, outDir string) *projectconfig.ZeroProjectConfig {
// fillProviderDetails(&projectConfig, s)
// fmt.Println(&projectConfig)
moduleSources := chooseStack(getRegistry())
moduleConfig := loadAllModules(moduleSources)
for _ = range moduleConfig {
moduleConfigs := loadAllModules(moduleSources)
for _ = range moduleConfigs {
// TODO: initialize module structs inside project
}

projectParameters := promptAllModules(moduleConfig)

projectParameters := promptAllModules(moduleConfigs)
for k, v = range projectParameters {
projectConfig.Context[k] = v
projectConfig.Context[k] = v
// TODO: Add parameters to module structs inside project
}

Expand All @@ -63,10 +62,8 @@ func Init(projectName string, outDir string) *projectconfig.ZeroProjectConfig {
return &projectConfig
}

// loadAllModules takes a list of module sources, downloads those modules, and parses their config
func loadAllModules(moduleSources []string) map[string]moduleconfig.ModuleConfig {
// TODO: do we need to run through the modules and extract first
// or we need to run through twice, potentially still need to pre-process for global auths

modules := make(map[string]moduleconfig.ModuleConfig)

for _, moduleSource := range moduleSources {
Expand All @@ -79,6 +76,7 @@ func loadAllModules(moduleSources []string) map[string]moduleconfig.ModuleConfig
return modules
}

// promptAllModules takes a map of all the modules and prompts the user for values for all the parameters
func promptAllModules(modules map[string]moduleconfig.ModuleConfig) map[string]string {
parameterValues := make(map[string]string)
for _, config := range modules {
Expand Down
1 change: 1 addition & 0 deletions internal/module/module.go
Expand Up @@ -57,6 +57,7 @@ func sanitizePromptResult(str string) string {
}

// TODO : Use this function signature instead
// PromptParams renders series of prompt UI based on the config
func PromptParams(moduleConfig moduleconfig.ModuleConfig, parameters map[string]string) (map[string]string, error) {
return map[string]string{}, nil
}
Expand Down

0 comments on commit ab95383

Please sign in to comment.