From ca40035398c16abfc78a14e52e3f8640f4eac37c Mon Sep 17 00:00:00 2001 From: RanXom Date: Sun, 12 Jul 2026 23:11:32 +0530 Subject: feat(scanner): skip hidden directories fix(code): fix misc. code in scanner and walker --- internal/scanner/walker.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'internal/scanner/walker.go') diff --git a/internal/scanner/walker.go b/internal/scanner/walker.go index c1de97a..ad37679 100644 --- a/internal/scanner/walker.go +++ b/internal/scanner/walker.go @@ -6,10 +6,10 @@ import ( "path/filepath" ) -func (s* Scanner) walk(ctx context.Context, root string) ([]File, error) { +func (s *Scanner) walk(ctx context.Context, root string) ([]File, error) { files := make([]File, 0) - err := filepath:WalkDir(root, func(path string, d fs.DirEntry, err error) error { + err := filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error { select { case <-ctx.Done(): return ctx.Err() @@ -21,6 +21,10 @@ func (s* Scanner) walk(ctx context.Context, root string) ([]File, error) { } if d.IsDir() { + if shouldSkipDir(d.Name()) { + return filepath.SkipDir + } + return nil } @@ -28,11 +32,7 @@ func (s* Scanner) walk(ctx context.Context, root string) ([]File, error) { return nil } - info, err != nil { - return err - } - - rel, err := d.Info() + info, err := d.Info() if err != nil { return err } -- cgit v1.2.3