From fcd8ea08e905dcf7508713c4d324376efd464b3a Mon Sep 17 00:00:00 2001 From: Han Qiao Date: Wed, 9 Oct 2024 02:45:55 +0800 Subject: [PATCH] fix: update path separator for windows glob (#2735) --- pkg/config/config.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 0b2468224..80270124c 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -14,6 +14,7 @@ import ( "net/http" "net/url" "os" + "path" "path/filepath" "regexp" "sort" @@ -1061,8 +1062,10 @@ func (c *seed) loadSeedPaths(basePath string, fsys fs.FS) error { } set := make(map[string]struct{}) for _, pattern := range c.GlobPatterns { + // Glob expects / as path separator on windows + pattern = filepath.ToSlash(pattern) if !filepath.IsAbs(pattern) { - pattern = filepath.Join(basePath, pattern) + pattern = path.Join(basePath, pattern) } matches, err := fs.Glob(fsys, pattern) if err != nil {