Skip to content

Commit

Permalink
support recursive globs (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
sami-alajrami authored Feb 27, 2024
1 parent 71df7a8 commit e2f2283
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ require (
github.com/stretchr/testify v1.8.4
github.com/xanzy/go-gitlab v0.81.0
github.com/xeonx/timeago v1.0.0-rc5
github.com/yargevad/filepathx v1.0.0
golang.org/x/oauth2 v0.10.0
k8s.io/api v0.29.0
k8s.io/apimachinery v0.29.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,8 @@ github.com/xeonx/timeago v1.0.0-rc5 h1:pwcQGpaH3eLfPtXeyPA4DmHWjoQt0Ea7/++FwpxqL
github.com/xeonx/timeago v1.0.0-rc5/go.mod h1:qDLrYEFynLO7y5Ho7w3GwgtYgpy5UfhcXIIQvMKVDkA=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/yargevad/filepathx v1.0.0 h1:SYcT+N3tYGi+NvazubCNlvgIPbzAk7i7y2dwg3I5FYc=
github.com/yargevad/filepathx v1.0.0/go.mod h1:BprfX/gpYNJHJfc35GjRRpVcwWXS89gGulUIU5tK3tA=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
3 changes: 2 additions & 1 deletion internal/digest/digest.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/kosli-dev/cli/internal/logger"
"github.com/kosli-dev/cli/internal/requests"
"github.com/kosli-dev/cli/internal/utils"
"github.com/yargevad/filepathx"
)

var (
Expand Down Expand Up @@ -61,7 +62,7 @@ func DirSha256(dirPath string, excludePaths []string, logger *logger.Logger) (st
func calculateDirContentSha256(digestsFile *os.File, dirPath, tmpDir string, excludePaths []string, logger *logger.Logger) error {
pathsToExclude := []string{}
for _, p := range excludePaths {
found, err := filepath.Glob(filepath.Join(dirPath, p))
found, err := filepathx.Glob(filepath.Join(dirPath, p))
if err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/kosli-dev/cli/internal/digest"
"github.com/kosli-dev/cli/internal/logger"
"github.com/yargevad/filepathx"
)

// ServerEnvRequest represents the PUT request body to be sent to kosli from a server
Expand All @@ -28,7 +29,7 @@ func CreateServerArtifactsData(paths, excludePaths []string, logger *logger.Logg

pathsToInclude := []string{}
for _, p := range paths {
found, err := filepath.Glob(p)
found, err := filepathx.Glob(p)
if err != nil {
return []*ServerData{}, err
}
Expand Down

0 comments on commit e2f2283

Please sign in to comment.