From ec9a05a092129041aeb1c464855ae4999f7d71df Mon Sep 17 00:00:00 2001 From: Inex Code Date: Sun, 31 Dec 2023 18:06:00 +0300 Subject: [PATCH] fix: use copytree --- selfprivacy_api/migrations/migrate_to_flakes.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/selfprivacy_api/migrations/migrate_to_flakes.py b/selfprivacy_api/migrations/migrate_to_flakes.py index 9063fcf..d648e90 100644 --- a/selfprivacy_api/migrations/migrate_to_flakes.py +++ b/selfprivacy_api/migrations/migrate_to_flakes.py @@ -91,11 +91,7 @@ class MigrateToFlakes(Migration): with tarfile.open(archive_path, "r:gz") as tar: tar.extractall(path=temp_dir) extracted_folder = os.path.join(temp_dir, "selfprivacy-nixos-template") - for root, _, files in os.walk(extracted_folder): - for file in files: - src_path = os.path.join(root, file) - dest_path = os.path.join("/etc/nixos", file) - shutil.copy2(src_path, dest_path) + shutil.copytree(extracted_folder, "/etc/nixos") finally: shutil.rmtree(temp_dir)