Skip to content

Commit

Permalink
fix: koji project parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Jul 23, 2024
1 parent f5f346b commit 329ab69
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions areas/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,19 @@ func (cfg *Config) Validate() error {
return fmt.Errorf("'areas.koji_url' looks malformed: '%s'(%s) does not start with '%s'", uri.Path, uri.String(), fcStr)
}

cfg.KojiProject = uri.Path[len(fcStr):]
for i, s := range strings.Split(cfg.KojiUrl, fcStr) {
switch i {
case 0:
cfg.KojiBaseUrl = s
case 1:
cfg.KojiProject = s
}
}

if cfg.KojiProject == "" {
return fmt.Errorf("'areas.koji_url' looks malformed: the project is missing")
}

uri.Path = ""
cfg.KojiBaseUrl = uri.String()

return nil
}

Expand Down

0 comments on commit 329ab69

Please sign in to comment.