Explorar el Código

Get prebooted apps to acknowledge sys.config

Change the order from load-config -> start-apps to load-apps ->
load-config -> start-apps
pull/473/head
Fred Hebert hace 10 años
padre
commit
2e7eb8f410
Se han modificado 1 ficheros con 16 adiciones y 3 borrados
  1. +16
    -3
      src/rebar_prv_shell.erl

+ 16
- 3
src/rebar_prv_shell.erl Ver fichero

@ -80,11 +80,9 @@ format_error(Reason) ->
shell(State) ->
setup_paths(State),
ok = reread_config(State),
maybe_boot_apps(State),
setup_shell(),
rebar_agent:start_link(State),
%% try to read in sys.config file
%% this call never returns (until user quits shell)
timer:sleep(infinity).
@ -133,11 +131,26 @@ reread_config(State) ->
maybe_boot_apps(State) ->
case rebar_state:get(State, shell_apps, undefined) of
undefined ->
ok;
%% try to read in sys.config file
ok = reread_config(State);
Apps ->
%% load apps, then check config, then boot them.
load_apps(Apps),
ok = reread_config(State),
boot_apps(Apps)
end.
load_apps(Apps) ->
[case application:load(App) of
ok ->
{ok, Ks} = application:get_all_key(App),
load_apps(proplists:get_value(applications, Ks));
_ ->
error % will be caught when starting the app
end || App <- Apps,
not lists:keymember(App, 1, application:loaded_applications())],
ok.
boot_apps(Apps) ->
?WARN("The rebar3 shell is a development tool; to deploy "
"applications in production, consider using releases "

Cargando…
Cancelar
Guardar