Skip to content

Commit 2db2652

Browse files
damienbarkerGitlab CI
authored andcommitted
update copy exisiting for nested files
1 parent 2ec7682 commit 2db2652

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Tools/PythonTools/update_expected_output.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ def copy_existing_output(output_dir, expected_dir):
88
print("One of the directories does not exist.")
99
return
1010

11-
for file in output_dir.iterdir():
11+
for file in output_dir.rglob('*'):
1212
if file.is_file():
13-
target = expected_dir / file.name
14-
if target.exists():
13+
rel = file.relative_to(output_dir)
14+
target = expected_dir / rel
15+
if target.exists() and target.is_file():
1516
shutil.copy2(file, target)
1617
print(f"Copied {file.name} to ExpectedOutput")
1718
else:

0 commit comments

Comments
 (0)