summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2024-03-18 22:02:08 +0100
committerMattes D <github@xoft.cz>2024-03-18 22:02:08 +0100
commitb3563495c364522742c51509fa0d27ef043b33c7 (patch)
treeb22d7431cb244eaa0f81c92afeef1fb85bdb8663
parentPlugin InfoReg: Read the info from param (diff)
downloadcuberite-b3563495c364522742c51509fa0d27ef043b33c7.tar
cuberite-b3563495c364522742c51509fa0d27ef043b33c7.tar.gz
cuberite-b3563495c364522742c51509fa0d27ef043b33c7.tar.bz2
cuberite-b3563495c364522742c51509fa0d27ef043b33c7.tar.lz
cuberite-b3563495c364522742c51509fa0d27ef043b33c7.tar.xz
cuberite-b3563495c364522742c51509fa0d27ef043b33c7.tar.zst
cuberite-b3563495c364522742c51509fa0d27ef043b33c7.zip
-rw-r--r--Server/Plugins/InfoDump.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/Server/Plugins/InfoDump.lua b/Server/Plugins/InfoDump.lua
index 1cb957947..4daf22383 100644
--- a/Server/Plugins/InfoDump.lua
+++ b/Server/Plugins/InfoDump.lua
@@ -3,7 +3,7 @@
-- InfoDump.lua
--[[
-Loads plugins' Info.lua and dumps its g_PluginInfo into various text formats
+Loads plugins' Info.lua and dumps its g_PluginInfo (or gPluginInfo) into various text formats
This is used for generating plugin documentation for the forum and for GitHub's INFO.md files
This script can be used in two ways:
@@ -650,8 +650,8 @@ end
---- Tries to load the g_PluginInfo from the plugin's Info.lua file
--- Returns the g_PluginInfo table on success, or nil and error message on failure
+--- Tries to load the g_PluginInfo or gPluginInfo from the plugin's Info.lua file
+-- Returns the plugin info table on success, or nil and error message on failure
local function LoadPluginInfo(a_FolderName)
-- Load and compile the Info file:
local cfg, err = loadfile(a_FolderName .. "/Info.lua")
@@ -668,10 +668,12 @@ local function LoadPluginInfo(a_FolderName)
return nil, "Cannot load Info.lua: " .. (errMsg or "<unknown error>")
end
- if (Sandbox.g_PluginInfo == nil) then
- return nil, "Info.lua doesn't contain the g_PluginInfo declaration"
+ if (Sandbox.g_PluginInfo) then
+ return Sandbox.g_PluginInfo
+ elseif (Sandbox.gPluginInfo) then
+ return Sandbox.gPluginInfo
end
- return Sandbox.g_PluginInfo
+ return nil, "Info.lua doesn't contain the g_PluginInfo declaration"
end