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

Function GetProjectNames

utils/librarypath/dproj_itil.go:135–159  ·  view source on GitHub ↗
(pkg *models.Package)

Source from the content-addressed store, hash-verified

133}
134
135func GetProjectNames(pkg *models.Package) []string {
136 var result []string
137 var matches = 0
138
139 if len(pkg.Projects) > 0 {
140 result = pkg.Projects
141 } else {
142 files, err := ioutil.ReadDir(env.GetCurrentDir())
143 if err != nil {
144 panic(err)
145 }
146
147 regex := regexp.MustCompile(".*.dproj|.*.lpi$")
148
149 for _, file := range files {
150 matched := regex.MatchString(file.Name())
151 if matched {
152 result = append(result, env.GetCurrentDir()+string(filepath.Separator)+file.Name())
153 matches++
154 }
155 }
156 }
157
158 return result
159}
160
161func isLazarus() bool {
162 files, err := ioutil.ReadDir(env.GetCurrentDir())

Callers 2

InjectDpcsFunction · 0.92
updateDprojLibraryPathFunction · 0.85

Calls 1

GetCurrentDirFunction · 0.92

Tested by

no test coverage detected