From 321c18b6bdf30a1a6e5caa5db9a21618983a069b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=A4felfinger?= Date: Sun, 7 Apr 2019 00:12:01 +0200 Subject: [PATCH] ignore hidden files and folders --- internal/pkg/localFileStructure/filesystemScanner.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/pkg/localFileStructure/filesystemScanner.go b/internal/pkg/localFileStructure/filesystemScanner.go index ba3cf7f..5f9631b 100644 --- a/internal/pkg/localFileStructure/filesystemScanner.go +++ b/internal/pkg/localFileStructure/filesystemScanner.go @@ -44,6 +44,11 @@ func ScanLocalFileStructure(path string) (map[string]*FilesystemNode, error) { return nil } + if strings.HasPrefix(info.Name(), ".") { + logrus.Tracef("Skipping hidden file or directory %s", path) + return nil + } + extension := strings.ToLower(filepath.Ext(path)) if extension != ".jpg" && extension != ".png" && !info.IsDir() { return nil