Skip to content

Commit 9205ca1

Browse files
committed
Rename project.findProjects() to project.findProjectsUnderPath()
The former name was too similar to project.FindProjects().
1 parent 30018d6 commit 9205ca1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

project/project.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func FindProjects() ([]Type, error) {
5151
return nil, fmt.Errorf("specified path %s is not an Arduino project", targetPath.String())
5252
}
5353

54-
foundProjects = append(foundProjects, findProjects(targetPath, superprojectTypeFilter, recursive)...)
54+
foundProjects = append(foundProjects, findProjectsUnderPath(targetPath, superprojectTypeFilter, recursive)...)
5555

5656
if foundProjects == nil {
5757
return nil, fmt.Errorf("no projects found under %s", targetPath.String())
@@ -60,8 +60,8 @@ func FindProjects() ([]Type, error) {
6060
return foundProjects, nil
6161
}
6262

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 {
6565
var foundProjects []Type
6666

6767
isProject, foundProjectType := isProject(targetPath, projectType)
@@ -86,7 +86,7 @@ func findProjects(targetPath *paths.Path, projectType projecttype.Type, recursiv
8686
directoryListing, _ := targetPath.ReadDir()
8787
directoryListing.FilterDirs()
8888
for _, potentialProjectDirectory := range directoryListing {
89-
foundProjects = append(foundProjects, findProjects(potentialProjectDirectory, projectType, recursive)...)
89+
foundProjects = append(foundProjects, findProjectsUnderPath(potentialProjectDirectory, projectType, recursive)...)
9090
}
9191
}
9292

@@ -104,14 +104,14 @@ func findSubprojects(superproject Type, apexSuperprojectType projecttype.Type) [
104104
return nil
105105
case projecttype.Library:
106106
subprojectPath := superproject.Path.Join("examples")
107-
immediateSubprojects = append(immediateSubprojects, findProjects(subprojectPath, projecttype.Sketch, true)...)
107+
immediateSubprojects = append(immediateSubprojects, findProjectsUnderPath(subprojectPath, projecttype.Sketch, true)...)
108108
// Apparently there is some level of official support for "example" in addition to the specification-compliant "examples".
109109
// see: https://github.com/arduino/arduino-cli/blob/0.13.0/arduino/libraries/loader.go#L153
110110
subprojectPath = superproject.Path.Join("example")
111-
immediateSubprojects = append(immediateSubprojects, findProjects(subprojectPath, projecttype.Sketch, true)...)
111+
immediateSubprojects = append(immediateSubprojects, findProjectsUnderPath(subprojectPath, projecttype.Sketch, true)...)
112112
case projecttype.Platform:
113113
subprojectPath := superproject.Path.Join("libraries")
114-
immediateSubprojects = append(immediateSubprojects, findProjects(subprojectPath, projecttype.Library, false)...)
114+
immediateSubprojects = append(immediateSubprojects, findProjectsUnderPath(subprojectPath, projecttype.Library, false)...)
115115
case projecttype.PackageIndex:
116116
// Platform indexes don't have subprojects
117117
return nil

0 commit comments

Comments
 (0)