From a1395a382a5d458c29f2c03b0b27a332f89408a2 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Mon, 14 Jan 2019 18:23:10 -0800 Subject: [PATCH] Support semver metadata in plugin version --- plugin/src/Config.lua | 2 +- plugin/src/Version.lua | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/plugin/src/Config.lua b/plugin/src/Config.lua index 09cb5eb8..657e873e 100644 --- a/plugin/src/Config.lua +++ b/plugin/src/Config.lua @@ -1,6 +1,6 @@ return { codename = "Epiphany", - version = {0, 5, 0}, + version = {0, 5, 0, "-alpha.0"}, expectedServerVersionString = "0.5.0 or newer", protocolVersion = 2, defaultHost = "localhost", diff --git a/plugin/src/Version.lua b/plugin/src/Version.lua index 24483fa0..f7dd88f3 100644 --- a/plugin/src/Version.lua +++ b/plugin/src/Version.lua @@ -34,7 +34,13 @@ function Version.compare(a, b) end function Version.display(version) - return table.concat(version, ".") + local output = ("%d.%d.%d"):format(version[1], version[2], version[3]) + + if version[4] ~= nil then + output = output .. version[4] + end + + return output end -return Version +return Version \ No newline at end of file