Fix plugin load bug

This commit is contained in:
Gilbert Wong 2019-05-08 11:53:10 +08:00 committed by Gilbert
parent 3ece73b912
commit fc6f54602d
1 changed files with 2 additions and 2 deletions

View File

@ -271,7 +271,7 @@ plugin_loaded(Name, true) ->
case lists:member(Name, Names) of
false ->
%% write file if plugin is loaded
write_loaded(lists:append(Names, [Name]));
write_loaded(lists:append(Names, [{Name, true}]));
true ->
ignore
end;
@ -308,7 +308,7 @@ write_loaded(AppNames) ->
case file:open(File, [binary, write]) of
{ok, Fd} ->
lists:foreach(fun(Name) ->
file:write(Fd, iolist_to_binary(io_lib:format("~s.~n", [Name])))
file:write(Fd, iolist_to_binary(io_lib:format("~p.~n", [Name])))
end, AppNames);
{error, Error} ->
?LOG(error, "[Plugins] Open File ~p Error: ~p", [File, Error]),