fix: 🚑️ fallback when symlink detection fails

This commit is contained in:
melMass
2023-10-12 12:42:24 +02:00
parent bb90e0415f
commit 278f22c209
+9 -5
View File
@@ -112,11 +112,15 @@ web_extensions_root = comfy_dir / "web" / "extensions"
web_mtb = web_extensions_root / "mtb"
if web_mtb.exists() and hasattr(nodes, "EXTENSION_WEB_DIRS"):
if os.path.islink(web_mtb):
os.unlink(web_mtb)
else:
shutil.rmtree(web_mtb)
try:
if web_mtb.is_symlink():
web_mtb.unlink()
else:
shutil.rmtree(web_mtb)
except Exception as e:
log.warning(
f"Failed to remove web mtb directory: {e}\nPlease manually remove it from disk ({web_mtb}) and restart the server."
)
# - REGISTER NODES