build/windows: Restrict clean() output of bundling script

This is the python version of c748b3d2
This commit is contained in:
Bruno Lopes 2025-04-18 14:00:14 -03:00
parent a683495b09
commit f88ca87ca9
No known key found for this signature in database

View file

@ -46,10 +46,13 @@ def bundle(src_root, pattern):
def clean(base_path, pattern): def clean(base_path, pattern):
base_path = Path(base_path) base_path = Path(base_path)
first_found = False
for parent_path in base_path.glob(os.path.dirname(pattern)): for parent_path in base_path.glob(os.path.dirname(pattern)):
for path in parent_path.rglob(os.path.basename(pattern)): for path in parent_path.rglob(os.path.basename(pattern)):
if path.exists(): if path.exists():
print(f"Cleaning {path}") if not first_found:
print(f"Cleaning {base_path}/{pattern}")
first_found = True
if path.is_dir(): if path.is_dir():
shutil.rmtree(path) shutil.rmtree(path)
else: else: