@@ -63,13 +63,10 @@ PluginManager::PluginManager() : ll::plugin::PluginManager(PluginManagerName) {}
63
63
auto PluginManager::load (ll::plugin::Manifest manifest) -> bool {
64
64
auto & logger = getSelfPluginInstance ().getLogger ();
65
65
#ifdef LEGACY_SCRIPT_ENGINE_BACKEND_PYTHON
66
- // "dirPath" is public temp dir (LLSE_PLUGIN_PACKAGE_TEMP_DIR) or normal
67
- // plugin dir "packagePath" will point to plugin package path if
68
- // isUncompressedFirstTime == true
69
- std::filesystem::path dirPath = ll::plugin::getPluginsRoot () / manifest.name ;
70
- std::string entryPath = PythonHelper::findEntryScript (dirPath.string ());
71
- if (entryPath.empty ()) return false ;
72
- std::string pluginName = PythonHelper::getPluginPackageName (dirPath.string ());
66
+ std::filesystem::path dirPath = ll::plugin::getPluginsRoot () / manifest.name ; // Plugin path
67
+ // std::string entryPath = PythonHelper::findEntryScript(dirPath.string()); // Plugin entry
68
+ // if (entryPath.empty()) return false;
69
+ // std::string pluginName = PythonHelper::getPluginPackageName(dirPath.string()); // Plugin name
73
70
74
71
// Run "pip install" if needed
75
72
auto realPackageInstallDir = (std::filesystem::path (dirPath) / " site-packages" ).make_preferred ();
@@ -78,7 +75,7 @@ auto PluginManager::load(ll::plugin::Manifest manifest) -> bool {
78
75
if (!dependTmpFilePath.empty ()) {
79
76
int exitCode = 0 ;
80
77
lse::getSelfPluginInstance ().getLogger ().info (" llse.loader.python.executePipInstall.start" _tr (
81
- fmt::arg (" name" , ll::string_utils::u8str2str (std::filesystem::path ( dirPath) .filename ().u8string ()))
78
+ fmt::arg (" name" , ll::string_utils::u8str2str (dirPath.filename ().u8string ()))
82
79
));
83
80
84
81
if ((exitCode = PythonHelper::executePipCommand (
@@ -99,17 +96,17 @@ auto PluginManager::load(ll::plugin::Manifest manifest) -> bool {
99
96
}
100
97
#endif
101
98
#ifdef LEGACY_SCRIPT_ENGINE_BACKEND_NODEJS
102
- std::filesystem::path dirPath = ll::plugin::getPluginsRoot () / manifest.name ;
103
- std::string entryPath = NodeJsHelper::findEntryScript (dirPath.string ());
104
- if (entryPath.empty ()) return false ;
105
- std::string pluginName = NodeJsHelper::getPluginPackageName (dirPath.string ());
99
+ std::filesystem::path dirPath = ll::plugin::getPluginsRoot () / manifest.name ; // Plugin path
100
+ // std::string entryPath = NodeJsHelper::findEntryScript(dirPath.string()); // Plugin entry
101
+ // if (entryPath.empty()) return false;
102
+ // std::string pluginName = NodeJsHelper::getPluginPackageName(dirPath.string()); // Plugin name
106
103
107
104
// Run "npm install" if needed
108
105
if (NodeJsHelper::doesPluginPackHasDependency (dirPath.string ())
109
106
&& !std::filesystem::exists (std::filesystem::path (dirPath) / " node_modules" )) {
110
107
int exitCode = 0 ;
111
108
lse::getSelfPluginInstance ().getLogger ().info (" llse.loader.nodejs.executeNpmInstall.start" _tr (
112
- fmt::arg (" name" , ll::string_utils::u8str2str (std::filesystem::path ( dirPath) .filename ().u8string ()))
109
+ fmt::arg (" name" , ll::string_utils::u8str2str (dirPath.filename ().u8string ()))
113
110
));
114
111
if ((exitCode = NodeJsHelper::executeNpmCommand (" npm install" , dirPath.string ())) == 0 )
115
112
lse::getSelfPluginInstance ().getLogger ().info (" llse.loader.nodejs.executeNpmInstall.success" _tr ());
@@ -181,12 +178,12 @@ auto PluginManager::load(ll::plugin::Manifest manifest) -> bool {
181
178
ENGINE_OWN_DATA ()->pluginFileOrDirPath = entryPath.string ();
182
179
#ifdef LEGACY_SCRIPT_ENGINE_BACKEND_PYTHON
183
180
if (!PythonHelper::loadPluginCode (&scriptEngine, entryPath.string (), dirPath.string ())) {
184
- throw std::runtime_error (fmt::format (" Failed to load plugin {0} " , manifest. name ));
181
+ throw std::runtime_error (fmt::format (" failed to load plugin code " ));
185
182
}
186
183
#endif
187
184
#ifdef LEGACY_SCRIPT_ENGINE_BACKEND_NODEJS
188
185
if (!NodeJsHelper::loadPluginCode (&scriptEngine, entryPath.string (), dirPath.string ())) {
189
- throw std::runtime_error (fmt::format (" Failed to load plugin {0} " , manifest. name ));
186
+ throw std::runtime_error (fmt::format (" failed to load plugin code " ));
190
187
}
191
188
#endif
192
189
#if (defined LEGACY_SCRIPT_ENGINE_BACKEND_QUICKJS) || (defined LEGACY_SCRIPT_ENGINE_BACKEND_LUA)
0 commit comments