Skip to content

Commit

Permalink
Update pkg/config/config.go
Browse files Browse the repository at this point in the history
Co-authored-by: John McBride <[email protected]>
  • Loading branch information
nickytonline and jpmcb authored Aug 28, 2024
1 parent d24095c commit 06d1eca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ func LoadConfig(path string, fallbackPath string) (*Spec, error) {

data, err := os.ReadFile(absPath)
if err != nil {

// If the file does not exist, check if the fallback path exists
if os.IsNotExist(err) {
_, err = os.Stat(fallbackPath)
if err != nil {
return nil, fmt.Errorf("error reading config file from %s or %s", absPath, fallbackPath)
}
} else {
return nil, fmt.Errorf("error reading config file: %w", err)
}
}

Expand Down

0 comments on commit 06d1eca

Please sign in to comment.