mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
Mix the commands update_all/0 and update_module/1 into update/1 (EJAB-1237)
This commit is contained in:
parent
75c5803431
commit
72b2209c3e
@ -32,7 +32,7 @@
|
|||||||
status/0, reopen_log/0,
|
status/0, reopen_log/0,
|
||||||
stop_kindly/2, send_service_message_all_mucs/2,
|
stop_kindly/2, send_service_message_all_mucs/2,
|
||||||
%% Erlang
|
%% Erlang
|
||||||
update_list/0, update_all/0, update_module/1,
|
update_list/0, update/1,
|
||||||
%% Accounts
|
%% Accounts
|
||||||
register/3, unregister/2,
|
register/3, unregister/2,
|
||||||
registered_users/1,
|
registered_users/1,
|
||||||
@ -102,14 +102,9 @@ commands() ->
|
|||||||
module = ?MODULE, function = update_list_modified,
|
module = ?MODULE, function = update_list_modified,
|
||||||
args = [],
|
args = [],
|
||||||
result = {modules, {list, {module, string}}}},
|
result = {modules, {list, {module, string}}}},
|
||||||
#ejabberd_commands{name = update_all, tags = [server],
|
#ejabberd_commands{name = update, tags = [server],
|
||||||
desc = "Update all the modified modules",
|
desc = "Update the given module, or use the keyword: all",
|
||||||
module = ?MODULE, function = update_all,
|
module = ?MODULE, function = update,
|
||||||
args = [],
|
|
||||||
result = {res, rescode}},
|
|
||||||
#ejabberd_commands{name = update_module, tags = [server],
|
|
||||||
desc = "Update the given module",
|
|
||||||
module = ?MODULE, function = update_module,
|
|
||||||
args = [{module, string}],
|
args = [{module, string}],
|
||||||
result = {res, rescode}},
|
result = {res, rescode}},
|
||||||
|
|
||||||
@ -299,8 +294,10 @@ update_list() ->
|
|||||||
ejabberd_update:update_info(),
|
ejabberd_update:update_info(),
|
||||||
[atom_to_list(Beam) || Beam <- UpdatedBeams].
|
[atom_to_list(Beam) || Beam <- UpdatedBeams].
|
||||||
|
|
||||||
update_all() ->
|
update("all") ->
|
||||||
[update_module(ModStr) || ModStr <- update_list()].
|
[update_module(ModStr) || ModStr <- update_list()];
|
||||||
|
update(ModStr) ->
|
||||||
|
update_module(ModStr).
|
||||||
|
|
||||||
update_module(ModuleNameString) ->
|
update_module(ModuleNameString) ->
|
||||||
ModuleName = list_to_atom(ModuleNameString),
|
ModuleName = list_to_atom(ModuleNameString),
|
||||||
|
Loading…
Reference in New Issue
Block a user