@@ -143,16 +143,16 @@ func findSubprojects(superproject Type, apexSuperprojectType projecttype.Type) [
143
143
// isProject determines if a path contains an Arduino project, and if so which type.
144
144
func isProject (potentialProjectPath * paths.Path , projectType projecttype.Type ) (bool , projecttype.Type ) {
145
145
logrus .Tracef ("Checking if %s is %s" , potentialProjectPath , projectType )
146
- if ( projectType == projecttype . All || projectType == projecttype .Sketch ) && isSketch (potentialProjectPath ) {
146
+ if projectType . Matches ( projecttype .Sketch ) && isSketch (potentialProjectPath ) {
147
147
logrus .Tracef ("%s is %s" , potentialProjectPath , projecttype .Sketch )
148
148
return true , projecttype .Sketch
149
- } else if ( projectType == projecttype . All || projectType == projecttype .Library ) && isLibrary (potentialProjectPath ) {
149
+ } else if projectType . Matches ( projecttype .Library ) && isLibrary (potentialProjectPath ) {
150
150
logrus .Tracef ("%s is %s" , potentialProjectPath , projecttype .Library )
151
151
return true , projecttype .Library
152
- } else if ( projectType == projecttype . All || projectType == projecttype .Platform ) && isPlatform (potentialProjectPath ) {
152
+ } else if projectType . Matches ( projecttype .Platform ) && isPlatform (potentialProjectPath ) {
153
153
logrus .Tracef ("%s is %s" , potentialProjectPath , projecttype .Platform )
154
154
return true , projecttype .Platform
155
- } else if ( projectType == projecttype . All || projectType == projecttype .PackageIndex ) && isPackageIndex (potentialProjectPath ) {
155
+ } else if projectType . Matches ( projecttype .PackageIndex ) && isPackageIndex (potentialProjectPath ) {
156
156
logrus .Tracef ("%s is %s" , potentialProjectPath , projecttype .PackageIndex )
157
157
return true , projecttype .PackageIndex
158
158
}
@@ -162,16 +162,16 @@ func isProject(potentialProjectPath *paths.Path, projectType projecttype.Type) (
162
162
// isProject determines if a file is the indicator file for an Arduino project, and if so which type.
163
163
func isProjectIndicatorFile (potentialProjectFilePath * paths.Path , projectType projecttype.Type ) (bool , projecttype.Type ) {
164
164
logrus .Tracef ("Checking if %s is %s indicator file" , potentialProjectFilePath , projectType )
165
- if ( projectType == projecttype . All || projectType == projecttype .Sketch ) && isSketchIndicatorFile (potentialProjectFilePath ) {
165
+ if projectType . Matches ( projecttype .Sketch ) && isSketchIndicatorFile (potentialProjectFilePath ) {
166
166
logrus .Tracef ("%s is %s indicator file" , potentialProjectFilePath , projecttype .Sketch )
167
167
return true , projecttype .Sketch
168
- } else if ( projectType == projecttype . All || projectType == projecttype .Library ) && isLibraryIndicatorFile (potentialProjectFilePath ) {
168
+ } else if projectType . Matches ( projecttype .Library ) && isLibraryIndicatorFile (potentialProjectFilePath ) {
169
169
logrus .Tracef ("%s is %s indicator file" , potentialProjectFilePath , projecttype .Library )
170
170
return true , projecttype .Library
171
- } else if ( projectType == projecttype . All || projectType == projecttype .Platform ) && isPlatformIndicatorFile (potentialProjectFilePath ) {
171
+ } else if projectType . Matches ( projecttype .Platform ) && isPlatformIndicatorFile (potentialProjectFilePath ) {
172
172
logrus .Tracef ("%s is %s indicator file" , potentialProjectFilePath , projecttype .Platform )
173
173
return true , projecttype .Platform
174
- } else if ( projectType == projecttype . All || projectType == projecttype .PackageIndex ) && isPackageIndexIndicatorFile (potentialProjectFilePath ) {
174
+ } else if projectType . Matches ( projecttype .PackageIndex ) && isPackageIndexIndicatorFile (potentialProjectFilePath ) {
175
175
logrus .Tracef ("%s is %s indicator file" , potentialProjectFilePath , projecttype .PackageIndex )
176
176
return true , projecttype .PackageIndex
177
177
}
0 commit comments