diff --git a/__init__.py b/__init__.py index 13586d9..6ead716 100644 --- a/__init__.py +++ b/__init__.py @@ -2,23 +2,24 @@ import glob import os import sys -import __main__ import filecmp import shutil +import folder_paths NODE_CLASS_MAPPINGS = {} NODE_DISPLAY_NAME_MAPPINGS = {} python = sys.executable + try: - extentions_folder = os.path.join(os.path.dirname(os.path.realpath(__main__.__file__)), - "web" + os.sep + "extensions" + os.sep + "dzNodes") + base_path = os.path.dirname(folder_paths.base_path) + extentions_folder = os.path.join(base_path, "web", "extensions", "dzNodes") javascript_folder = os.path.join(os.path.dirname(os.path.realpath(__file__)), "js") outdate_file_list = ['comfy_shared.js', 'debug.js', 'mtb_widgets.js', 'parse-css.js', 'dz_widgets.js'] - + if not os.path.exists(extentions_folder): print('# 😺dzNodes: Making the "web\extensions\dzNodes" folder') - os.mkdir(extentions_folder) + os.makedirs(extentions_folder, exist_ok=True) else: for i in outdate_file_list: outdate_file = os.path.join(extentions_folder, i)