retry installation

pull/254/head
Joe Marshall 2024-01-13 08:30:34 +00:00
rodzic cc0e1ce3c3
commit f80676fdb7
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -10,10 +10,18 @@ bpy.ops.preferences.addon_enable(module='cam')
bpy.ops.wm.save_userpref()
"""
NUM_RETRIES=10
with tempfile.TemporaryDirectory() as td:
file=pathlib.Path(td,"install.py")
file.write_text(INSTALL_CODE)
command = f'blender -b -P "{str(file)}"'
subprocess.run(command, shell=True, check=True)
# blender 4.0 installing addon crashes sometimes on mac github actions...
for x in range(NUM_RETRIES):
try:
subprocess.run(command, shell=True, check=True)
sys.exit(0)
except Exception as e:
print("Install addon failed, retrying:",e)