Use full path and arguments for subprocess

This commit is contained in:
Mykola Grymalyuk
2023-12-30 13:49:59 -07:00
parent b46e55d3f6
commit 0dfcf03c0c
23 changed files with 152 additions and 154 deletions

View File

@@ -184,13 +184,13 @@ class UpdateFrame(wx.Frame):
"""
logging.info("Extracting update")
if Path(self.application_path).exists():
subprocess.run(["rm", "-rf", str(self.application_path)])
subprocess.run(["/bin/rm", "-rf", str(self.application_path)])
# Some hell spawn at Github decided to double zip our Github Actions artifacts
# So we need to unzip it twice
for i in range(2):
result = subprocess.run(
["ditto", "-xk", str(self.constants.payload_path / "OpenCore-Patcher-GUI.app.zip"), str(self.constants.payload_path)], capture_output=True
["/usr/bin/ditto", "-xk", str(self.constants.payload_path / "OpenCore-Patcher-GUI.app.zip"), str(self.constants.payload_path)], capture_output=True
)
if result.returncode != 0:
logging.error(f"Failed to extract update. Error: {result.stderr.decode('utf-8')}")