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

Function getDefaultPath

utils/librarypath/librarypath.go:64–90  ·  view source on GitHub ↗
(fullPath bool, rootPath string)

Source from the content-addressed store, hash-verified

62}
63
64func getDefaultPath(fullPath bool, rootPath string) []string {
65 var paths []string
66
67 if !fullPath {
68 fullPath := filepath.Join(env.GetCurrentDir(), consts.FolderDependencies, consts.DcpFolder)
69
70 dir, err := filepath.Rel(rootPath, fullPath)
71 if err == nil {
72 paths = append(paths, dir)
73 }
74
75 fullPath = filepath.Join(env.GetCurrentDir(), consts.FolderDependencies, consts.DcuFolder)
76 dir, err = filepath.Rel(rootPath, fullPath)
77 if err == nil {
78 paths = append(paths, dir)
79 }
80 } else {
81 paths = append(paths, filepath.Join(env.GetCurrentDir(), consts.FolderDependencies, consts.DcpFolder))
82 paths = append(paths, filepath.Join(env.GetCurrentDir(), consts.FolderDependencies, consts.DcuFolder))
83 }
84
85 if isLazarus() {
86 return paths
87 }
88
89 return append(paths, "$(DCC_UnitSearchPath)")
90}
91
92func cleanEmpty(paths []string) []string {
93 for index, value := range paths {

Callers 1

getNewPathsFromDirFunction · 0.85

Calls 2

GetCurrentDirFunction · 0.92
isLazarusFunction · 0.85

Tested by

no test coverage detected