From 3cc4d863deb306357a4001e87073a0693c311405 Mon Sep 17 00:00:00 2001 From: Flo Greistorfer Date: Mon, 8 Jul 2024 08:41:14 +0200 Subject: [PATCH] glob support added to filesystem traverse --- builder.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/builder.py b/builder.py index 94daf28..646af71 100755 --- a/builder.py +++ b/builder.py @@ -129,7 +129,12 @@ def get_total_folders(folder: str, _total: int = 0) -> int: if item not in EXCLUDES: if os.path.isdir(os.path.join(folder, item)): if item not in args.exclude_folders: - _total = get_total_folders(os.path.join(folder, item), _total) + skip = False + for exclude in args.exclude_folders: + if fnmatch.fnmatchcase(os.path.join(folder, item), exclude): + skip = True + if not skip: + _total = get_total_folders(os.path.join(folder, item), _total) return _total