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
Revision as of 22:11, 16 November 2017 by imported>Krinkle (Krinkle moved page Module:Version to Module:CurrentVersion without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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