You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Module:CurrentVersion

From Wikitech-static
Jump to navigation Jump to search

Documentation for this module may be created at Module:CurrentVersion/doc (Test casesTest results)

local p = {}

-- "1.00.0-tag.00 (git hash)"
function p.display(frame)
  return mw.site.currentVersion
end

-- "1.00.0-tag.00"
function p.full(frame)
  return string.match(mw.site.currentVersion, "[^ ]+")
end

-- "1.00.0"
function p.patch(frame)
  return string.match(mw.site.currentVersion, "[^- ]+")
end

-- "1.00"
function p.release(frame)
  return string.match(mw.site.currentVersion, "[^- .]+\.[^- .]+")
end

return p