Skip to content

Commit

Permalink
🐛 Fix custom rules.
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Ortel <jortel@redhat.com>
  • Loading branch information
jortel committed Dec 4, 2023
1 parent 87a0c06 commit 7525b2b
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions cmd/rules.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package main

import (
"github.com/konveyor/tackle2-addon/command"
"github.com/konveyor/tackle2-addon/repository"
"github.com/konveyor/tackle2-hub/api"
"github.com/konveyor/tackle2-hub/nas"
"github.com/rogpeppe/go-internal/semver"
"os"
"path"
"regexp"
"strconv"
"strings"

"github.com/konveyor/tackle2-addon/command"
"github.com/konveyor/tackle2-addon/repository"
"github.com/konveyor/tackle2-hub/api"
"github.com/konveyor/tackle2-hub/nas"
"github.com/rogpeppe/go-internal/semver"
)

type History = map[uint]byte
Expand Down Expand Up @@ -70,12 +71,23 @@ func (r *Rules) addFiles() (err error) {
if err != nil {
return
}
r.rules = append(r.rules, ruleDir)
addon.Activity(
"[RULESET] fetching: %s",
r.Path)
bucket := addon.Bucket()
err = bucket.Get(r.Path, ruleDir)
if err != nil {
return
}
entries, err := os.ReadDir(ruleDir)
if err != nil {
return
}
for _, ent := range entries {
r.rules = append(
r.rules,
path.Join(ruleDir, ent.Name()))
}
return
}

Expand Down

0 comments on commit 7525b2b

Please sign in to comment.