ignore hidden files and folders

This commit is contained in:
Philipp Häfelfinger 2019-04-07 00:12:01 +02:00
parent 5ca8a92e22
commit 321c18b6bd

View File

@ -44,6 +44,11 @@ func ScanLocalFileStructure(path string) (map[string]*FilesystemNode, error) {
return nil return nil
} }
if strings.HasPrefix(info.Name(), ".") {
logrus.Tracef("Skipping hidden file or directory %s", path)
return nil
}
extension := strings.ToLower(filepath.Ext(path)) extension := strings.ToLower(filepath.Ext(path))
if extension != ".jpg" && extension != ".png" && !info.IsDir() { if extension != ".jpg" && extension != ".png" && !info.IsDir() {
return nil return nil