Skip to content

Commit f5cb7d3

Browse files
Don't scan hidden directories (.git, etc.)
Port of arduino/arduino-builder#328 When checking for updated core files, don't scan inside UNIX hidden directories like .git. Scanning inside a GIT tree for a large project with many branches could take many minutes of runtime and multiple GB of RAM. This was seen in the Arduino core for the ESP8266, but is probably also an issue for other core development teams. Fixes arduino/arduino-builder#327 Signed-off-by: Earle F. Philhower, III <[email protected]>
1 parent d550b66 commit f5cb7d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: legacy/builder/builder_utils/utils.go

+4
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ func findAllFilesInFolder(sourcePath string, recurse bool) ([]string, error) {
154154
}
155155

156156
for _, folder := range folders {
157+
// Skip any hidden directories (.git, .tmp, etc.)
158+
if strings.HasPrefix(folder.Name(), ".") {
159+
continue
160+
}
157161
otherSources, err := findAllFilesInFolder(filepath.Join(sourcePath, folder.Name()), recurse)
158162
if err != nil {
159163
return nil, i18n.WrapError(err)

0 commit comments

Comments
 (0)