mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 01:39:35 +02:00
Allow passing multiple paths in external_beams
This commit is contained in:
parent
780031847c
commit
425504454c
1 changed files with 15 additions and 8 deletions
|
@ -305,14 +305,21 @@ beams(external) ->
|
|||
end
|
||||
end, ExtMods),
|
||||
case application:get_env(ejabberd, external_beams) of
|
||||
{ok, Path} ->
|
||||
case lists:member(Path, code:get_path()) of
|
||||
true -> ok;
|
||||
false -> code:add_patha(Path)
|
||||
end,
|
||||
Beams = filelib:wildcard(filename:join(Path, "*\.beam")),
|
||||
CustMods = [list_to_atom(filename:rootname(filename:basename(Beam)))
|
||||
|| Beam <- Beams],
|
||||
{ok, Path0} ->
|
||||
Paths = case Path0 of
|
||||
[L|_] = V when is_list(L) -> V;
|
||||
L -> [L]
|
||||
end,
|
||||
CustMods = lists:foldl(
|
||||
fun(Path, CM) ->
|
||||
case lists:member(Path, code:get_path()) of
|
||||
true -> ok;
|
||||
false -> code:add_patha(Path)
|
||||
end,
|
||||
Beams = filelib:wildcard(filename:join(Path, "*\.beam")),
|
||||
CM ++ [list_to_atom(filename:rootname(filename:basename(Beam)))
|
||||
|| Beam <- Beams]
|
||||
end, [], Paths),
|
||||
CustMods ++ ExtMods;
|
||||
_ ->
|
||||
ExtMods
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue