Skip to content

Commit ff77f91

Browse files
committed
Skip directories early
1 parent a045e59 commit ff77f91

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

utils/utils.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ func GetCompatibleWith(name string) map[string][]firmware {
5959
fw := regexp.MustCompile(knownBoards[name].match)
6060

6161
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
62+
if info.IsDir() {
63+
return nil
64+
}
6265
unixPath := filepath.ToSlash(path)
6366
parts := strings.Split(unixPath, "/")
6467
fancyName := parts[len(parts)-3] + " " + parts[len(parts)-2]
@@ -67,9 +70,6 @@ func GetCompatibleWith(name string) map[string][]firmware {
6770
Name: fancyName,
6871
IsLoader: loader.MatchString(path) && !listAll,
6972
}
70-
if info.IsDir() {
71-
return nil
72-
}
7373
folder := filepath.Dir(path)
7474
lowerPath, _ := filepath.Rel(root, path)
7575
lowerPath = strings.ToLower(lowerPath)

0 commit comments

Comments
 (0)