Skip to content

Commit

Permalink
skip hidden files when list files with given extension (#10654)
Browse files Browse the repository at this point in the history
for #10644
  • Loading branch information
AskAlexSharov authored Jun 17, 2024
1 parent cac1c2d commit 1704658
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions erigon-lib/common/dir/rw_dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package dir
import (
"os"
"path/filepath"
"strings"

"golang.org/x/sync/errgroup"
)
Expand Down Expand Up @@ -133,6 +134,9 @@ func ListFiles(dir string, extensions ...string) (paths []string, err error) {
if f.IsDir() && !f.Type().IsRegular() {
continue
}
if strings.HasPrefix(f.Name(), ".") {
continue
}
match := false
if len(extensions) == 0 {
match = true
Expand Down

0 comments on commit 1704658

Please sign in to comment.