summaryrefslogtreecommitdiff
path: root/src/rebar_prv_escriptize.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2015-04-17 13:45:40 -0400
committerFred Hebert <mononcqc@ferd.ca>2015-04-17 13:45:40 -0400
commit123b0ea61afd5d1524d0c08b5e8ebcc3b01f0866 (patch)
tree473bd543a33fc16907e59df950edce0e5f486897 /src/rebar_prv_escriptize.erl
parentcbd22cf49003421214880b252015f331f4346e6e (diff)
parent400853033e849cff05318a27df1e0f9cd9868a77 (diff)
Merge pull request #342 from tsloughter/relx_fixes
Mainly CT changes
Diffstat (limited to 'src/rebar_prv_escriptize.erl')
-rw-r--r--src/rebar_prv_escriptize.erl34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/rebar_prv_escriptize.erl b/src/rebar_prv_escriptize.erl
index d17699e..12ceaca 100644
--- a/src/rebar_prv_escriptize.erl
+++ b/src/rebar_prv_escriptize.erl
@@ -62,22 +62,21 @@ desc() ->
do(State) ->
?INFO("Building escript...", []),
- escriptize(State).
-
-escriptize(State0) ->
- App1 = case rebar_state:project_apps(State0) of
- [App] ->
- App;
- Apps ->
- case rebar_state:get(State0, escript_main_app, undefined) of
- undefined ->
- ?PRV_ERROR(no_main_app);
- Name ->
- rebar_app_utils:find(Name, Apps)
- end
- end,
-
- AppName = rebar_app_info:name(App1),
+ case rebar_state:project_apps(State) of
+ [App] ->
+ escriptize(State, App);
+ Apps ->
+ case rebar_state:get(State, escript_main_app, undefined) of
+ undefined ->
+ ?PRV_ERROR(no_main_app);
+ Name ->
+ AppInfo = rebar_app_utils:find(Name, Apps),
+ escriptize(State, AppInfo)
+ end
+ end.
+
+escriptize(State0, App) ->
+ AppName = rebar_app_info:name(App),
AppNameStr = ec_cnv:to_list(AppName),
%% Get the output filename for the escript -- this may include dirs
@@ -152,7 +151,8 @@ get_app_beams([App | Rest], Acc) ->
Path ->
Prefix = filename:join(atom_to_list(App), "ebin"),
Acc2 = load_files(Prefix, "*.beam", Path),
- get_app_beams(Rest, Acc2 ++ Acc)
+ Acc3 = load_files(Prefix, "*.app", Path),
+ get_app_beams(Rest, Acc3 ++ Acc2 ++ Acc)
end.
get_extra(State) ->