25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-10-07 14:58:56 +02:00

The command Update now returns meaningful message and exit-status (EJAB-1237)

This commit is contained in:
Badlop 2010-07-22 16:32:55 +02:00
parent 8c4884d665
commit cf4f0dbe6d

View File

@ -106,7 +106,7 @@ commands() ->
desc = "Update the given module, or use the keyword: all",
module = ?MODULE, function = update,
args = [{module, string}],
result = {res, rescode}},
result = {res, restuple}},
#ejabberd_commands{name = register, tags = [accounts],
desc = "Register a user",
@ -305,7 +305,10 @@ update(ModStr) ->
update_module(ModuleNameString) ->
ModuleName = list_to_atom(ModuleNameString),
ejabberd_update:update([ModuleName]).
case ejabberd_update:update([ModuleName]) of
{ok, Res} -> {ok, io_lib:format("Updated: ~p", [Res])};
{error, Reason} -> {error, Reason}
end.
%%%
%%% Account management