mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-02-16 14:24:29 +00:00
fix: extracting files from the archive
This commit is contained in:
parent
a9df81e1c6
commit
30a03c1c5a
|
@ -89,7 +89,13 @@ class MigrateToFlakes(Migration):
|
|||
urllib.request.urlretrieve(archive_url, archive_path)
|
||||
|
||||
with tarfile.open(archive_path, "r:gz") as tar:
|
||||
tar.extractall(path="/etc/nixos")
|
||||
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)
|
||||
|
||||
finally:
|
||||
shutil.rmtree(temp_dir)
|
||||
|
|
Loading…
Reference in a new issue