Skip to content

Commit

Permalink
checkpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <[email protected]>
  • Loading branch information
jortel committed Jul 30, 2024
1 parent 77c845f commit ce5e909
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ func (r *Labels) extract(paths []string) (err error) {
inspect := func(p string, info fs.FileInfo, wErr error) (_ error) {
var err error
if wErr != nil || info.IsDir() {
addon.Log.Error(wErr, p)
return
}
switch strings.ToUpper(path.Ext(p)) {
Expand Down Expand Up @@ -469,13 +470,17 @@ func (r *Labels) extract(paths []string) (err error) {
// addIncluded uniquely adds labels to the included set.
func (r *Labels) addIncluded(extracted ...string) (added []string) {
for _, s := range extracted {
found := false
for _, included := range r.Included {
if included == s {
return
found = true
break
}
}
added = append(added, s)
r.Included = append(r.Included, s)
if !found {
added = append(added, s)
r.Included = append(r.Included, s)
}
}
return
}
Expand Down

0 comments on commit ce5e909

Please sign in to comment.