mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-29 07:21:27 +00:00
fix: use copytree
This commit is contained in:
parent
30a03c1c5a
commit
ec9a05a092
|
@ -91,11 +91,7 @@ class MigrateToFlakes(Migration):
|
||||||
with tarfile.open(archive_path, "r:gz") as tar:
|
with tarfile.open(archive_path, "r:gz") as tar:
|
||||||
tar.extractall(path=temp_dir)
|
tar.extractall(path=temp_dir)
|
||||||
extracted_folder = os.path.join(temp_dir, "selfprivacy-nixos-template")
|
extracted_folder = os.path.join(temp_dir, "selfprivacy-nixos-template")
|
||||||
for root, _, files in os.walk(extracted_folder):
|
shutil.copytree(extracted_folder, "/etc/nixos")
|
||||||
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)
|
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
shutil.rmtree(temp_dir)
|
shutil.rmtree(temp_dir)
|
||||||
|
|
Loading…
Reference in a new issue