From b7b989433a9cabf509d1f120363ebd02ff6f4f51 Mon Sep 17 00:00:00 2001 From: xenofem Date: Mon, 11 Mar 2024 12:44:06 -0400 Subject: [PATCH] ignore directories that don't contain any files we care about --- dlibrary/dlibrary.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlibrary/dlibrary.py b/dlibrary/dlibrary.py index 6344f9b..a08ccbc 100755 --- a/dlibrary/dlibrary.py +++ b/dlibrary/dlibrary.py @@ -266,6 +266,8 @@ class Collator: self.index = 0 def collate_from_paths(self, srcs): + srcs = [src for src in srcs if len(descendant_files_ignore(src, self.exclude)) > 0] + if len(srcs) == 1 and srcs[0].is_dir(): return self.collate_from_paths(ls_ignore(srcs[0], self.exclude))