MCPcopy Create free account
hub / github.com/HashLoad/boss / cleanPath

Function cleanPath

utils/librarypath/librarypath.go:25–41  ·  view source on GitHub ↗
(paths []string, fullPath bool)

Source from the content-addressed store, hash-verified

23}
24
25func cleanPath(paths []string, fullPath bool) []string {
26 prefix := env.GetModulesDir()
27 var processedPaths []string
28 if !fullPath {
29 prefix, _ = filepath.Rel(env.GetCurrentDir(), prefix)
30 }
31
32 for key := 0; key < len(paths); key++ {
33 if strings.HasPrefix(paths[key], prefix) {
34 continue
35 }
36 if !utils.Contains(processedPaths, paths[key]) {
37 processedPaths = append(processedPaths, paths[key])
38 }
39 }
40 return processedPaths
41}
42
43func GetNewPaths(paths []string, fullPath bool, rootPath string) []string {
44 paths = cleanPath(paths, fullPath)

Callers 1

GetNewPathsFunction · 0.85

Calls 3

GetModulesDirFunction · 0.92
GetCurrentDirFunction · 0.92
ContainsFunction · 0.92

Tested by

no test coverage detected