forgejo-aneksajo_auto_patch.../5_copy_individual_files.py
2025-01-23 01:26:39 +01:00

15 lines
392 B
Python

from pathlib import Path
import os
import shutil
source_dir: str = "forgejo-aneksajo"
with open("individuals.txt","r") as file_handle:
data = file_handle.readlines()
for file in data:
file = file[:-1]
basedir = os.path.dirname(file)
if len(basedir) > 0:
os.makedirs(f"export/{basedir}", exist_ok=True)
shutil.copy2(f"{source_dir}/{file}", f"export/{file}")