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:
parent
30df1dbe3f
commit
fa3c25ab66
8
mix.exs
8
mix.exs
@ -171,7 +171,13 @@ defmodule Ejabberd.MixProject do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp vars do
|
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
|
{:ok,config} -> config
|
||||||
_ -> [zlib: true]
|
_ -> [zlib: true]
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user