mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
Fix plugin version not being loaded
Load the version of the plugin from its package.json file and document this requirement in the writing plugins document.
This commit is contained in:
1 parent
c5a14db8ea
commit
1b0b245484
3 files changed
+23
-9
No files matched your search
@@ -402,9 +402,11 @@ async function loadPluginInfos(pluginList) {
|
||||
let plugins = [];
|
||||
for (let [pluginName, pluginPath] of pluginList) {
|
||||
let pluginInfo;
|
||||
let pluginPackage;
|
||||
|
||||
try {
|
||||
pluginInfo = require(path.posix.join(pluginPath, "info"));
|
||||
pluginPackage = require(path.posix.join(pluginPath, "package.json"));
|
||||
|
||||
} catch (err) {
|
||||
throw new errors.PluginError(pluginName, err);
|
||||
@@ -417,6 +419,7 @@ async function loadPluginInfos(pluginList) {
|
||||
}
|
||||
|
||||
pluginInfo.requirePath = pluginPath;
|
||||
pluginInfo.version = pluginPackage.version;
|
||||
plugins.push(pluginInfo);
|
||||
}
|
||||
return plugins;
|
||||
|
||||
Reference in new issue
Block a user