소스 검색

restructure escriptize provider so the error is properly returned

pull/342/head
Tristan Sloughter 10 년 전
부모
커밋
a917dc14df
1개의 변경된 파일17개의 추가작업 그리고 17개의 파일을 삭제
  1. +17
    -17
      src/rebar_prv_escriptize.erl

+ 17
- 17
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) ->

불러오는 중...
취소
저장