From fa3c25ab661349a8ce0afe9ec8657c11f82de3a2 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 26 Dec 2023 13:11:34 +0100 Subject: [PATCH] Mix: New option vars_config_path to set path to vars.config (4128) Useful when setting ejabberd as dependency in another Elixir project, and you want to enable or disable some ejabberd dependencies, see https://www.process-one.net/blog/how-to-use-ejabberd-as-an-elixir-application-dependency/ --- mix.exs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mix.exs b/mix.exs index 11b347df8..9eba55213 100644 --- a/mix.exs +++ b/mix.exs @@ -171,7 +171,13 @@ defmodule Ejabberd.MixProject do end defp vars do - case :file.consult("vars.config") do + filepath = case Application.fetch_env(:ejabberd, :vars_config_path) do + :error -> + "vars.config" + {:ok, path} -> + path + end + case :file.consult(filepath) do {:ok,config} -> config _ -> [zlib: true] end