diff --git a/go.mod b/go.mod index 2b5023e3e67..0ed8d7a4f11 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module cuelang.org/go go 1.17 require ( + github.com/bmatcuk/doublestar/v4 v4.2.0 github.com/cockroachdb/apd/v2 v2.0.2 github.com/emicklei/proto v1.10.0 github.com/google/go-cmp v0.5.8 diff --git a/go.sum b/go.sum index f123b013f62..3503ecf0ab9 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/bmatcuk/doublestar/v4 v4.2.0 h1:Qu+u9wR3Vd89LnlLMHvnZ5coJMWKQamqdz9/p5GNthA= +github.com/bmatcuk/doublestar/v4 v4.2.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= diff --git a/pkg/tool/file/file.go b/pkg/tool/file/file.go index 5f865f47b30..67cec99ce9f 100644 --- a/pkg/tool/file/file.go +++ b/pkg/tool/file/file.go @@ -25,6 +25,8 @@ import ( "cuelang.org/go/cue" "cuelang.org/go/cue/errors" "cuelang.org/go/internal/task" + + "github.com/bmatcuk/doublestar/v4" ) func init() { @@ -114,7 +116,8 @@ func (c *cmdGlob) Run(ctx *task.Context) (res interface{}, err error) { if ctx.Err != nil { return nil, ctx.Err } - m, err := filepath.Glob(glob) + + m, err := doublestar.FilepathGlob(glob) for i, s := range m { m[i] = filepath.ToSlash(s) }