Updated to also use shutil for JSON file copying

This commit is contained in:
fschuh
2025-05-05 12:32:29 -04:00
parent a58dd78be8
commit dad7666adb
2 changed files with 12 additions and 24 deletions

View File

@@ -284,8 +284,7 @@ def incremental_merge(source_dir: str, target_dir: str, media_dir: str, pretty_p
if not os.path.exists(target_path):
print(f"Copying '{json_file}' to target directory...")
os.makedirs(target_dir, exist_ok=True)
with open(source_path, 'rb') as src, open(target_path, 'wb') as dst:
dst.write(src.read())
shutil.copy2(source_path, target_path)
else:
print(
f"Merging '{json_file}' with existing file in target directory...")