Module:EcoVersionString: Difference between revisions

From Eco - English Wiki
[checked revision][checked revision]
m StalEF moved page Module:Eco version string to Module:EcoVersionString without leaving a redirect
No edit summary
Line 1: Line 1:
local p = {}
local p = {}
local VersionData = mw.loadData("Module:EcoVersion")
local VersionData = mw.loadData("Module:EcoVersionData")


function p.main()
function p.main()
assert(VersionData.eco, "Failed to load data from Module:EcoVersion!")
assert(VersionData.eco, "Failed to load data from Module:EcoVersionData!")


local ecoVersionString = VersionData.eco["eco"]["ecoVersion"]
local ecoVersionString = VersionData.eco["eco"]["ecoVersion"]

Revision as of 11:26, 25 June 2024


local p = {}
local VersionData = mw.loadData("Module:EcoVersionData")

function p.main()
	assert(VersionData.eco, "Failed to load data from Module:EcoVersionData!")

	local ecoVersionString = VersionData.eco["eco"]["ecoVersion"]
	
	if ecoVersionString then
		return ecoVersionString
	else
		return "<span style=\"color:red\">ERROR: Failed to load Eco version from data file.</span>"
	end
end

return p