@@ -19,7 +19,6 @@ import (
19
19
"fmt"
20
20
"os"
21
21
"path/filepath"
22
- "strings"
23
22
24
23
"github.com/arduino/arduino-cli/arduino/cores"
25
24
"github.com/arduino/arduino-cli/configuration"
@@ -163,7 +162,13 @@ func (pm *PackageManager) loadPlatforms(targetPackage *cores.Package, packageDir
163
162
164
163
// A platform can only be inside a directory, thus we skip everything else.
165
164
platformsDirs .FilterDirs ()
165
+ // Filter out directories like .git and similar things
166
+ platformsDirs .FilterOutPrefix ("." )
166
167
for _ , platformPath := range platformsDirs {
168
+ // Tools are not a platform
169
+ if platformPath .Base () == "tools" {
170
+ continue
171
+ }
167
172
if err := pm .loadPlatform (targetPackage , platformPath ); err != nil {
168
173
statuses = append (statuses , err )
169
174
}
@@ -178,13 +183,10 @@ func (pm *PackageManager) loadPlatforms(targetPackage *cores.Package, packageDir
178
183
func (pm * PackageManager ) loadPlatform (targetPackage * cores.Package , platformPath * paths.Path ) * status.Status {
179
184
// This is not a platform
180
185
if platformPath .IsNotDir () {
181
- return nil
186
+ return status . Newf ( codes . NotFound , "path is not a platform directory: %s" , platformPath )
182
187
}
183
188
184
189
architecture := platformPath .Base ()
185
- if strings .HasPrefix (architecture , "." ) || architecture == "tools" {
186
- return nil
187
- }
188
190
189
191
// There are two possible platform directory structures:
190
192
// - ARCHITECTURE/boards.txt
0 commit comments