From 9dac3ef988f7367d913a281c8f2fc1d28b3e93c2 Mon Sep 17 00:00:00 2001 From: maddalax Date: Mon, 28 Oct 2024 12:52:21 -0500 Subject: [PATCH] ensure the pattern matches too --- cli/htmgo/internal/dirutil/glob.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/htmgo/internal/dirutil/glob.go b/cli/htmgo/internal/dirutil/glob.go index 628a3ef..dd0f3b3 100644 --- a/cli/htmgo/internal/dirutil/glob.go +++ b/cli/htmgo/internal/dirutil/glob.go @@ -8,7 +8,8 @@ import ( func matchesAny(patterns []string, path string) bool { for _, pattern := range patterns { - matched, err := doublestar.Match(pattern, strings.ReplaceAll(path, `\`, "/")) + matched, err := + doublestar.Match(strings.ReplaceAll(pattern, `\`, "/"), strings.ReplaceAll(path, `\`, "/")) if err != nil { fmt.Printf("Error matching pattern: %v\n", err) return false