Jump to content

Module:CurrentVersion

From Wikitech

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