update js loading

This commit is contained in:
Tropfchen
2024-01-06 15:11:39 +01:00
parent b66c2e9486
commit 68ee689fa3
2 changed files with 7 additions and 13 deletions
+6 -12
View File
@@ -8,23 +8,17 @@ NODE_DISPLAY_NAME_MAPPINGS = {
}
# --------------------------- Install web extension ----------------------------
import shutil
# ------------------------ Remove copied web extension -------------------------
from pathlib import Path
# Get base paths
node_dir = Path(__file__).resolve().parent
comfy_dir = node_dir.parent.parent
script_path = node_dir / "js" / "quickNodes.js"
destination_dir = comfy_dir / "web" / "extensions" / "tropfchen"
destination_path = destination_dir / "yarsQuickNodes.js"
try:
destination_dir.mkdir(parents=True, exist_ok=True)
if destination_path.exists():
destination_path.unlink()
shutil.copy2(script_path, destination_path)
except PermissionError as permission_error:
print(f"Permission error: {permission_error}")
except Exception as e:
print(f"An unexpected error occurred: {e}")
# --------------------------- Install web extension ----------------------------
WEB_DIRECTORY = "./js"
__all__ = ["WEB_DIRECTORY"]