(pkg *models.Package)
| 133 | } |
| 134 | |
| 135 | func 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 | |
| 161 | func isLazarus() bool { |
| 162 | files, err := ioutil.ReadDir(env.GetCurrentDir()) |
no test coverage detected