Compare commits

..

No commits in common. "90d5a23fcc0df77b4b4a97360bd128c3dc106185" and "5f8e4f00ea238deb7d013de687929d6c2bb91052" have entirely different histories.

View File

@ -6,8 +6,6 @@ import (
"gopkg.in/yaml.v3"
"os"
"os/exec"
"path"
"path/filepath"
"slices"
"strings"
"syscall"
@ -98,30 +96,26 @@ func (hook *BPMHook) Execute(packageChanges map[string]string, verbose bool, roo
// Get modified files slice
modifiedFiles := make([]*PackageFileEntry, 0)
for pkg := range packageChanges {
for pkg, _ := range packageChanges {
modifiedFiles = append(modifiedFiles, GetPackageFiles(pkg, rootDir)...)
}
// Check if any targets are met
targetMet := false
for _, target := range hook.Targets {
for _, t1 := range hook.Targets {
if targetMet {
break
}
if hook.TargetType == "package" {
for change, operation := range packageChanges {
if target == change && slices.Contains(hook.TriggerOperations, operation) {
for t2, operation := range packageChanges {
if t1 == t2 && slices.Contains(hook.TriggerOperations, operation) {
targetMet = true
break
}
}
} else {
glob, err := filepath.Glob(path.Join(rootDir, target))
if err != nil {
return err
}
for _, change := range modifiedFiles {
if slices.Contains(glob, path.Join(rootDir, change.Path)) {
for _, t2 := range modifiedFiles {
if strings.HasPrefix(t2.Path, t1) {
targetMet = true
break
}