Fix inverted functionality of --case-sensitive flag, but actually apply the change when filtering

This commit is contained in:
Seednode 2023-09-25 17:13:31 -05:00
parent 271714f1de
commit 974a4c79fc
2 changed files with 11 additions and 3 deletions

View File

@ -42,7 +42,11 @@ func (filters *filters) apply(fileList []string) []string {
if filters.hasExcludes() {
for _, exclude := range filters.excluded {
result = slices.DeleteFunc(fileList, func(s string) bool {
return strings.Contains(strings.ToLower(s), strings.ToLower(exclude))
if CaseSensitive {
return strings.Contains(s, exclude)
} else {
return strings.Contains(strings.ToLower(s), strings.ToLower(exclude))
}
})
}
}
@ -50,7 +54,11 @@ func (filters *filters) apply(fileList []string) []string {
if filters.hasIncludes() {
for _, include := range filters.included {
result = slices.DeleteFunc(fileList, func(s string) bool {
return !strings.Contains(strings.ToLower(s), strings.ToLower(include))
if CaseSensitive {
return !strings.Contains(s, include)
} else {
return !strings.Contains(strings.ToLower(s), strings.ToLower(include))
}
})
}
}

View File

@ -11,7 +11,7 @@ import (
)
const (
ReleaseVersion string = "0.92.1"
ReleaseVersion string = "0.92.2"
)
var (