mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 11:06:20 +00:00
Expose Erlang API for invoking rebar
This commit is contained in:
parent
a7c32f8d98
commit
a2fb8fdc39
1 changed files with 7 additions and 0 deletions
|
@ -27,6 +27,7 @@
|
||||||
-module(rebar).
|
-module(rebar).
|
||||||
|
|
||||||
-export([main/1,
|
-export([main/1,
|
||||||
|
run/2,
|
||||||
help/0,
|
help/0,
|
||||||
parse_args/1,
|
parse_args/1,
|
||||||
version/0,
|
version/0,
|
||||||
|
@ -52,6 +53,7 @@
|
||||||
%% Public API
|
%% Public API
|
||||||
%% ====================================================================
|
%% ====================================================================
|
||||||
|
|
||||||
|
%% escript Entry point
|
||||||
main(Args) ->
|
main(Args) ->
|
||||||
case catch(run(Args)) of
|
case catch(run(Args)) of
|
||||||
ok ->
|
ok ->
|
||||||
|
@ -65,6 +67,11 @@ main(Args) ->
|
||||||
rebar_utils:delayed_halt(1)
|
rebar_utils:delayed_halt(1)
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
%% Erlang-API entry point
|
||||||
|
run(BaseConfig, Commands) ->
|
||||||
|
application:load(rebar),
|
||||||
|
run_aux(BaseConfig, Commands).
|
||||||
|
|
||||||
%% ====================================================================
|
%% ====================================================================
|
||||||
%% Internal functions
|
%% Internal functions
|
||||||
%% ====================================================================
|
%% ====================================================================
|
||||||
|
|
Loading…
Reference in a new issue