Browse Source

Make the escriptize provider hookable

This will allow to move and modify the generated files
pull/1299/head
Fred Hebert 8 years ago
parent
commit
ef3e9e7aa2
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      src/rebar_prv_escriptize.erl

+ 7
- 2
src/rebar_prv_escriptize.erl View File

@ -61,8 +61,11 @@ desc() ->
"the project's and its dependencies' BEAM files.". "the project's and its dependencies' BEAM files.".
do(State) -> do(State) ->
Providers = rebar_state:providers(State),
Cwd = rebar_state:dir(State),
rebar_hooks:run_project_and_app_hooks(Cwd, pre, ?PROVIDER, Providers, State),
?INFO("Building escript...", []), ?INFO("Building escript...", []),
case rebar_state:get(State, escript_main_app, undefined) of
Res = case rebar_state:get(State, escript_main_app, undefined) of
undefined -> undefined ->
case rebar_state:project_apps(State) of case rebar_state:project_apps(State) of
[App] -> [App] ->
@ -78,7 +81,9 @@ do(State) ->
_ -> _ ->
?PRV_ERROR({bad_name, Name}) ?PRV_ERROR({bad_name, Name})
end end
end.
end,
rebar_hooks:run_project_and_app_hooks(Cwd, post, ?PROVIDER, Providers, State),
Res.
escriptize(State0, App) -> escriptize(State0, App) ->
AppName = rebar_app_info:name(App), AppName = rebar_app_info:name(App),

Loading…
Cancel
Save