diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-05-29 14:06:49 +0000 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-05-29 14:06:49 +0000 |
commit | 398204b13e9b9073e14ce7311be6e54eb1eb956b (patch) | |
tree | 3e175af056db8508b6f9be84c31897de61689299 /src | |
parent | 2e7eb8f4102900031e2a7cbb28bedf7b0034e392 (diff) |
Add support to boot apps from releases in shell
Precedence still goes to shell_apps.
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_shell.erl | 15 |
1 files changed, 14 insertions, 1 deletions
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 -> |