From 72e069d9ec0f6402a74781a47afc441263d8e19d Mon Sep 17 00:00:00 2001 From: Badlop Date: Thu, 15 Jul 2021 20:54:56 +0200 Subject: [PATCH] Get ejabberd version from vars.config --- mix.exs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index e029c911b..669401560 100644 --- a/mix.exs +++ b/mix.exs @@ -3,7 +3,7 @@ defmodule Ejabberd.Mixfile do def project do [app: :ejabberd, - version: "21.4.0", + version: version(), description: description(), elixir: "~> 1.4", elixirc_paths: ["lib"], @@ -17,6 +17,14 @@ defmodule Ejabberd.Mixfile do deps: deps()] end + def version 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 + vsn -> String.replace(:erlang.list_to_binary(vsn), ".0", ".") + end + end + def description do """ Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)