Browse Source

下载插件

rambo 6 months ago
parent
commit
b7ffc971bd
1 changed files with 10 additions and 0 deletions
  1. 10 0
      python/service/init_load_source.py

+ 10 - 0
python/service/init_load_source.py

@@ -16,6 +16,16 @@ class init_load_source:
         response_data = await self.get_update_file(plugins_name="new_custom_plugins")
         if response_data:
             for relative_file_path, value in response_data['data'].items():
+                if "new_custom_plugins" in relative_file_path and os.path.exists("lib") == False:
+                    print("主目录不存在,不下载")
+                    continue
+                if (
+                    "new_custom_plugins" in relative_file_path
+                    and os.path.exists("lib")
+                ):
+                    relative_file_path = relative_file_path.replace(
+                        "new_custom_plugins", "lib/custom_plugins"
+                    )
                 file_path = f"{os.getcwd()}/{relative_file_path}"
                 if os.path.exists(file_path):
                     file_md5 = get_md5(file_path)