Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jortega0 committed Jul 20, 2024
1 parent 3e75e15 commit 281a8c6
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,30 @@ func stepsToTrigger(files []string, watch []WatchConfig) ([]Step, error) {
include_files := []string{}
// try to match the excludes
if len(excludes) != 0 {
for _, e := range excludes {
if strings.HasPrefix(e, "!") {
e = e[1:]
}
for _, f := range files {
for _, f := range files {
for _, e := range excludes {
if strings.HasPrefix(e, "!") {
e = e[1:]
}
// If the file matches an exclude, move on to the next file.
if env("MONOREPO_DIFF_DEBUG", "") == "true" {
fmt.Println("Checking if exclude pattern matches:\n", includes)
fmt.Println("Checking if exclude pattern matches:")
fmt.Println("Pattern:\n", e)
fmt.Println("File:\n", f)
}
match, err := matchPath(e, f)
if err != nil {
return nil, err
}
if !match {
if match {
if env("MONOREPO_DIFF_DEBUG", "") == "true" {
fmt.Println("Excluding file.\n", f)
}
break
} else {
if env("MONOREPO_DIFF_DEBUG", "") == "true" {
fmt.Println("Pattern did not match.")
}
include_files = append(include_files, f)
}
}
Expand All @@ -149,8 +157,8 @@ func stepsToTrigger(files []string, watch []WatchConfig) ([]Step, error) {
}

// Iterate over the filtered files for any matches
for _, i := range includes {
for _, f := range include_files {
for _, f := range include_files {
for _, i := range includes {
match, err := matchPath(i, f)
if err != nil {
return nil, err
Expand Down

0 comments on commit 281a8c6

Please sign in to comment.