Skip to content

Commit

Permalink
feat: merge cfg real and demo
Browse files Browse the repository at this point in the history
  • Loading branch information
haunt98 committed Feb 17, 2024
1 parent 9b906c4 commit 62b9ca2
Show file tree
Hide file tree
Showing 5 changed files with 333 additions and 408 deletions.
10 changes: 3 additions & 7 deletions internal/cli/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,13 @@ func (a *action) loadConfig(c *cli.Context, command string) (config.Config, erro
a.getFlags(c)
a.log("Start command [%s] with flags [%+v]\n", command, a.flags)

cfgReal, cfgDemo, err := config.LoadConfig(currentDir)
cfg, err := config.LoadConfig(currentDir, a.flags.dryRun)
if err != nil {
return nil, fmt.Errorf("config: failed to load: %w", err)
}
a.log("Config apps [%+v]\n", cfgReal.Apps)
a.log("Config apps %+v\n", cfg.List())

if a.flags.dryRun {
return cfgDemo, nil
}

return cfgReal, nil
return cfg, nil
}

func (a *action) getFlags(c *cli.Context) {
Expand Down
Loading

0 comments on commit 62b9ca2

Please sign in to comment.