Skip to content

Commit 4204cab

Browse files
committed
fix: bug in Windows where expanding globs was not working
In the doublestar library does not play well with windows C:\example\file\path The slashes need to be replaced with forward slashes before using the library.
1 parent 4a9a0cf commit 4204cab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/render/render.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"path/filepath"
2828
"reflect"
2929
"regexp"
30+
"runtime"
3031
"slices"
3132
"strings"
3233
"text/template"
@@ -335,6 +336,9 @@ func ExpandInclude(includeTpl flags.IncludeList) ([]string, error) {
335336
// expand the included templates
336337
allMatches := []string{}
337338
for _, includePattern := range includeTpl {
339+
if runtime.GOOS == "windows" {
340+
includePattern = filepath.ToSlash(includePattern)
341+
}
338342
basePath, pattern := doublestar.SplitPattern(includePattern)
339343
fSys := os.DirFS(basePath)
340344
matches, err := doublestar.Glob(fSys, pattern)

0 commit comments

Comments
 (0)