Skip to content

Commit

Permalink
fix migrating old configuration files when exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
xrstf committed Jun 1, 2020
1 parent 89ca465 commit 660046f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 8 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ func main() {
log.Fatalf("⚠ Failed to load config %q: %v.", configFile, err)
}

// validate config unless in export mode, where an incomplete
// configuration is allowed and even expected
if !exportMode {
if err := cfg.Validate(); err != nil {
log.Fatalf("Configuration is invalid: %v", err)
}
}

if validate {
log.Println("✓ Configuration is valid.")
return
Expand Down
4 changes: 0 additions & 4 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ func LoadFromFile(filename string) (*Config, error) {
return nil, err
}

if err := config.Validate(); err != nil {
return nil, err
}

return config, nil
}

Expand Down

0 comments on commit 660046f

Please sign in to comment.