From 398204b13e9b9073e14ce7311be6e54eb1eb956b Mon Sep 17 00:00:00 2001 From: Fred Hebert Date: Fri, 29 May 2015 14:06:49 +0000 Subject: Add support to boot apps from releases in shell Precedence still goes to shell_apps. --- src/rebar_prv_shell.erl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/rebar_prv_shell.erl b/src/rebar_prv_shell.erl index 9ecadf4..74e2386 100644 --- a/src/rebar_prv_shell.erl +++ b/src/rebar_prv_shell.erl @@ -129,7 +129,7 @@ reread_config(State) -> end. maybe_boot_apps(State) -> - case rebar_state:get(State, shell_apps, undefined) of + case find_apps_to_boot(State) of undefined -> %% try to read in sys.config file ok = reread_config(State); @@ -140,6 +140,19 @@ maybe_boot_apps(State) -> boot_apps(Apps) end. +find_apps_to_boot(State) -> + %% Try the shell_apps option + case rebar_state:get(State, shell_apps, undefined) of + undefined -> + %% Get to the relx tuple instead + case lists:keyfind(release, 1, rebar_state:get(State, relx, [])) of + {_, _, Apps} -> Apps; + false -> undefined + end; + Apps -> + Apps + end. + load_apps(Apps) -> [case application:load(App) of ok -> -- cgit v1.1