Allow boolean flag for loaded plugins

This is to simplify config templating
This commit is contained in:
spring2maz 2019-03-31 18:11:54 +02:00 committed by Gilbert
parent 60c2b8bc08
commit 55d2d1d278
1 changed files with 5 additions and 1 deletions

View File

@ -276,7 +276,11 @@ plugin_unloaded(_Name, false) ->
ok;
plugin_unloaded(Name, true) ->
case read_loaded() of
{ok, Names} ->
{ok, Names0} ->
Names = lists:filtermap(fun(Name) when is_atom(Name) -> {true, Name};
({Name, true}) -> {true, Name};
({Name, false}) -> false
end, Names0),
case lists:member(Name, Names) of
true ->
write_loaded(lists:delete(Name, Names));