Refactor theme installation code to use subprocess.run()

This commit is contained in:
Vladyslav Hroshev
2024-03-25 23:47:19 +02:00
parent f9a923508e
commit 71d37c40f9

View File

@@ -183,8 +183,10 @@ class GlobalTheme:
# install theme
print("Installing theme...")
os.system(f"sudo cp -f {self.extracted_theme}/{self.destination_file} "
f"{self.destination_folder}/{self.destination_file}")
subprocess.run(["sudo", "cp", "-f",
f"{self.extracted_theme}/{self.destination_file}",
f"{self.destination_folder}/{self.destination_file}"],
check=True)
return 0