Skip to content

Commit a546795

Browse files
committed
exclude more
1 parent aeb046b commit a546795

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

installation_and_upgrade/ibex_install_utils/tasks/backup_tasks.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,12 @@ def _backup_dir(
188188
strict_timestamps=False
189189
) as zf:
190190
for src_path, dirs, src_filenames in os.walk(src, topdown=True):
191-
excluded = ignore(src_path, src_filenames)
192-
dirs[:] = [d for d in dirs if d not in excluded]
191+
excluded_files = ignore(src_path, src_filenames)
192+
excluded_dirs = ignore(src_path, dirs)
193+
dirs[:] = [d for d in dirs if d not in excluded_dirs]
193194
for src_filename in src_filenames:
194195
path = os.path.normpath(os.path.join(src_path, src_filename))
195-
if os.path.isfile(path):
196+
if os.path.isfile(path) and src_filename not in excluded_files:
196197
self.progress_bar.progress += 1
197198
self.progress_bar.print()
198199
zf.write(path, os.path.relpath(path, src))

0 commit comments

Comments
 (0)