Skip to content

Commit

Permalink
fix for chmod
Browse files Browse the repository at this point in the history
  • Loading branch information
gorouflex authored Feb 23, 2024
1 parent 44c50cd commit 65f96ad
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions UXTU4Mac/Assets/Updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import urllib.request
import zipfile
import shutil
import subprocess

def update():
url = "https://github.com/AppleOSX/UXTU4Mac/releases/latest/download/UXTU4Mac.zip"
Expand All @@ -13,17 +14,14 @@ def update():
with zipfile.ZipFile(os.path.join(current_dir, "UXTU4Mac.zip"), 'r') as zip_ref:
zip_ref.extractall(new_folder)

uxtu_command_path = os.path.join(current_folder, "UXTU4Mac.command")
os.chmod(uxtu_command_path, 0o755)

assets_folder = os.path.join(new_folder, "Assets")
ryzenadj_path = os.path.join(assets_folder, "ryzenadj")
os.chmod(ryzenadj_path, 0o755)

shutil.rmtree(current_folder)
inner_folder = os.path.join(new_folder, "UXTU4Mac")
shutil.move(inner_folder, current_dir)
shutil.rmtree(new_folder)

# Add executable permissions to the files after the update
subprocess.call(['chmod', '+x', os.path.join(current_dir, "UXTU4Mac", "UXTU4Mac.command")])
subprocess.call(['chmod', '+x', os.path.join(current_dir, "UXTU4Mac", "Assets", "ryzenadj")])

if __name__ == "__main__":
update()

0 comments on commit 65f96ad

Please sign in to comment.