xfasfadgagsg commited on
Commit
fb4fb15
·
verified ·
1 Parent(s): 23b1b39

Update pyUltroid/startup/loader.py

Browse files
Files changed (1) hide show
  1. pyUltroid/startup/loader.py +10 -0
pyUltroid/startup/loader.py CHANGED
@@ -70,6 +70,16 @@ def load_other_plugins(addons=None, pmbot=None, manager=None, vcbot=None):
70
  if url := udB.get_key("ADDONS_URL"):
71
  subprocess.run(f"git clone -q {url} addons", shell=True)
72
  if os.path.exists("addons") and not os.path.exists("addons/.git"):
 
 
 
 
 
 
 
 
 
 
73
  rmtree("addons")
74
  if not os.path.exists("addons"):
75
  subprocess.run(
 
70
  if url := udB.get_key("ADDONS_URL"):
71
  subprocess.run(f"git clone -q {url} addons", shell=True)
72
  if os.path.exists("addons") and not os.path.exists("addons/.git"):
73
+ try:
74
+ # Fix permissions before deleting
75
+ for root, dirs, files in os.walk("addons"):
76
+ for d in dirs:
77
+ os.chmod(os.path.join(root, d), 0o777)
78
+ for f in files:
79
+ os.chmod(os.path.join(root, f), 0o666)
80
+ os.chmod("addons", 0o777)
81
+ except Exception as e:
82
+ print(f"[Permission Fix] Could not change permissions for 'addons': {e}")
83
  rmtree("addons")
84
  if not os.path.exists("addons"):
85
  subprocess.run(