MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / getDistinctPatternMatches

Function getDistinctPatternMatches

pkg/cmd/package/support/pack.go:257–270  ·  view source on GitHub ↗
(basePath string, patterns []string)

Source from the content-addressed store, hash-verified

255}
256
257func getDistinctPatternMatches(basePath string, patterns []string) ([]string, error) {
258 fileSys := os.DirFS(filepath.Clean(basePath))
259 var filePaths []string
260
261 for _, pattern := range patterns {
262 paths, err := doublestar.Glob(fileSys, filepath.ToSlash(pattern))
263 if err != nil {
264 return nil, err
265 }
266 filePaths = append(filePaths, paths...)
267 }
268
269 return util.SliceDistinct(filePaths), nil
270}

Callers 1

BuildPackageFunction · 0.85

Calls 1

SliceDistinctFunction · 0.92

Tested by

no test coverage detected