25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

When vsn is an exact tag, append .0 to satisfy SemVer

This commit is contained in:
Badlop 2021-07-26 16:36:21 +02:00
parent e3875482ba
commit 8e553decb0

View File

@ -24,6 +24,9 @@ defmodule Ejabberd.MixProject do
case config(:vsn) do
:false -> "0.0.0" # ./configure wasn't run: vars.config not created
'0.0' -> "0.0.0" # the full git repository wasn't downloaded
[_, _, ?., _, _] = x ->
head = String.replace(:erlang.list_to_binary(x), ~r/0+([0-9])/, "\\1")
<<head::binary, ".0">>
vsn -> String.replace(:erlang.list_to_binary(vsn), ~r/0+([0-9])/, "\\1")
end
end