Skip to content

Commit

Permalink
Support semver metadata in plugin version
Browse files Browse the repository at this point in the history
  • Loading branch information
LPGhatguy committed Jan 15, 2019
1 parent a543646 commit a1395a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugin/src/Config.lua
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
10 changes: 8 additions & 2 deletions plugin/src/Version.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a1395a3

Please sign in to comment.