Skip to content

Commit

Permalink
refactor wizard config variable to struct
Browse files Browse the repository at this point in the history
  • Loading branch information
brchri committed Jan 12, 2024
1 parent 773931d commit 5f7b967
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cmd/app/console/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ func RunWizard() {
os.Exit(0)
}()

type Config struct {
Global interface{} `yaml:"global"`
GarageDoors []interface{} `yaml:"garage_doors"`
}

asciiArt.NewFigure("Tesla-GeoGDO", "", false).Print()
asciiArt.NewFigure("Config Wizard", "", false).Print()

config := map[string]interface{}{}
// config := map[string]interface{}{}
config := Config{}
response := promptUser(
question{
prompt: "\n\nWould you like to use the wizard to generate your config file? [Y|n]",
Expand All @@ -54,8 +60,8 @@ func RunWizard() {
return
}

config["global"] = runGlobalPrompts()
config["garage_doors"] = runGarageDoorsPrompts()
config.Global = runGlobalPrompts()
config.GarageDoors = runGarageDoorsPrompts()

var b bytes.Buffer
yamlEncoder := yaml.NewEncoder(&b)
Expand Down

0 comments on commit 5f7b967

Please sign in to comment.