@@ -51,7 +51,7 @@ func FindProjects() ([]Type, error) {
51
51
return nil , fmt .Errorf ("specified path %s is not an Arduino project" , targetPath .String ())
52
52
}
53
53
54
- foundProjects = append (foundProjects , findProjects (targetPath , superprojectTypeFilter , recursive )... )
54
+ foundProjects = append (foundProjects , findProjectsUnderPath (targetPath , superprojectTypeFilter , recursive )... )
55
55
56
56
if foundProjects == nil {
57
57
return nil , fmt .Errorf ("no projects found under %s" , targetPath .String ())
@@ -60,8 +60,8 @@ func FindProjects() ([]Type, error) {
60
60
return foundProjects , nil
61
61
}
62
62
63
- // findProjects finds projects of the given type and subprojects of those projects. It returns a slice containing the definitions of all found projects.
64
- func findProjects (targetPath * paths.Path , projectType projecttype.Type , recursive bool ) []Type {
63
+ // findProjectsUnderPath finds projects of the given type and subprojects of those projects. It returns a slice containing the definitions of all found projects.
64
+ func findProjectsUnderPath (targetPath * paths.Path , projectType projecttype.Type , recursive bool ) []Type {
65
65
var foundProjects []Type
66
66
67
67
isProject , foundProjectType := isProject (targetPath , projectType )
@@ -86,7 +86,7 @@ func findProjects(targetPath *paths.Path, projectType projecttype.Type, recursiv
86
86
directoryListing , _ := targetPath .ReadDir ()
87
87
directoryListing .FilterDirs ()
88
88
for _ , potentialProjectDirectory := range directoryListing {
89
- foundProjects = append (foundProjects , findProjects (potentialProjectDirectory , projectType , recursive )... )
89
+ foundProjects = append (foundProjects , findProjectsUnderPath (potentialProjectDirectory , projectType , recursive )... )
90
90
}
91
91
}
92
92
@@ -104,14 +104,14 @@ func findSubprojects(superproject Type, apexSuperprojectType projecttype.Type) [
104
104
return nil
105
105
case projecttype .Library :
106
106
subprojectPath := superproject .Path .Join ("examples" )
107
- immediateSubprojects = append (immediateSubprojects , findProjects (subprojectPath , projecttype .Sketch , true )... )
107
+ immediateSubprojects = append (immediateSubprojects , findProjectsUnderPath (subprojectPath , projecttype .Sketch , true )... )
108
108
// Apparently there is some level of official support for "example" in addition to the specification-compliant "examples".
109
109
// see: https://github.com/arduino/arduino-cli/blob/0.13.0/arduino/libraries/loader.go#L153
110
110
subprojectPath = superproject .Path .Join ("example" )
111
- immediateSubprojects = append (immediateSubprojects , findProjects (subprojectPath , projecttype .Sketch , true )... )
111
+ immediateSubprojects = append (immediateSubprojects , findProjectsUnderPath (subprojectPath , projecttype .Sketch , true )... )
112
112
case projecttype .Platform :
113
113
subprojectPath := superproject .Path .Join ("libraries" )
114
- immediateSubprojects = append (immediateSubprojects , findProjects (subprojectPath , projecttype .Library , false )... )
114
+ immediateSubprojects = append (immediateSubprojects , findProjectsUnderPath (subprojectPath , projecttype .Library , false )... )
115
115
case projecttype .PackageIndex :
116
116
// Platform indexes don't have subprojects
117
117
return nil
0 commit comments