Skip to content

Commit

Permalink
Generate default config file on run when missing
Browse files Browse the repository at this point in the history
Seems we lost the autogeneration of the config file during latest refactoring.
Adding it back.

Signed-off-by: borod108 <[email protected]>
  • Loading branch information
borod108 authored and machacekondra committed Nov 7, 2024
1 parent 289dc36 commit 9d4cf52
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cmd/planner-api/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ var runCmd = &cobra.Command{
if configFile == "" {
configFile = config.ConfigFile()
}
cfg, err := config.NewFromFile(configFile)
cfg, err := config.LoadOrGenerate(configFile)
if err != nil {
log.Fatalf("reading configuration: %v", err)
}
log.Printf("Using config: %s", cfg)

logLvl, err := logrus.ParseLevel(cfg.Service.LogLevel)
if err != nil {
Expand Down

0 comments on commit 9d4cf52

Please sign in to comment.