Module:EcoVersionString: Difference between revisions

From Eco - English Wiki
[checked revision][checked revision]
No edit summary
No edit summary
Line 1: Line 1:
local p = {}
local p = {}
local VersionData = mw.loadData("Module:EcoVersionData")


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


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


return p
return p

Revision as of 11:53, 25 June 2024


local p = {}

function p.main()
	local VersionData = mw.loadData("Module:EcoVersionData")
	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.</span>"
	end
end

return p