chore(filegen): use strings.Contains for more flexible directory searching

This commit is contained in:
verse91
2026-05-10 00:12:40 +07:00
parent d74c959be4
commit c6cfdd0695
+10 -1
View File
@@ -87,7 +87,16 @@ func FileGenerator(filters ...string) GeneratorFunc {
continue
}
if filePrefix != "" && !HasPrefix(name, filePrefix) {
match := false
if filePrefix == "" {
match = true
} else if dirOnly {
match = strings.Contains(strings.ToLower(name), strings.ToLower(filePrefix))
} else {
match = HasPrefix(name, filePrefix)
}
if !match {
continue
}