mirror of
https://github.com/gocsaf/csaf.git
synced 2025-12-22 11:55:40 +01:00
Fallback to default config files if no config file was given.
This commit is contained in:
parent
9697e99d86
commit
1bdaf5854a
1 changed files with 3 additions and 1 deletions
|
|
@ -73,7 +73,9 @@ func (p *Parser[C]) Parse() ([]string, *C, error) {
|
||||||
// Do we have a config file explicitly given by command line?
|
// Do we have a config file explicitly given by command line?
|
||||||
if p.ConfigLocation != nil {
|
if p.ConfigLocation != nil {
|
||||||
path = p.ConfigLocation(&cmdLineOpts)
|
path = p.ConfigLocation(&cmdLineOpts)
|
||||||
} else {
|
}
|
||||||
|
// Fallback to defaults if we have not found any.
|
||||||
|
if path == "" && len(p.DefaultConfigLocations) > 0 {
|
||||||
path = findConfigFile(p.DefaultConfigLocations)
|
path = findConfigFile(p.DefaultConfigLocations)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue