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

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/
This commit is contained in:
Badlop 2023-12-26 13:11:34 +01:00
parent 30df1dbe3f
commit fa3c25ab66

View File

@ -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