summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2012-11-06 08:40:41 -0700
committerDave Smith <dizzyd@dizzyd.com>2012-11-06 08:40:41 -0700
commita2fb8fdc399506fdd858ae2113f78bf343af07d0 (patch)
treee07b14e699d16b524cf5f5d1a0cdad8bf9d9a6c7
parenta7c32f8d985d3ea236e5b83c4049df29eaa90df2 (diff)
Expose Erlang API for invoking rebar
-rw-r--r--src/rebar.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rebar.erl b/src/rebar.erl
index cd0bed5..82e3fac 100644
--- a/src/rebar.erl
+++ b/src/rebar.erl
@@ -27,6 +27,7 @@
-module(rebar).
-export([main/1,
+ run/2,
help/0,
parse_args/1,
version/0,
@@ -52,6 +53,7 @@
%% Public API
%% ====================================================================
+%% escript Entry point
main(Args) ->
case catch(run(Args)) of
ok ->
@@ -65,6 +67,11 @@ main(Args) ->
rebar_utils:delayed_halt(1)
end.
+%% Erlang-API entry point
+run(BaseConfig, Commands) ->
+ application:load(rebar),
+ run_aux(BaseConfig, Commands).
+
%% ====================================================================
%% Internal functions
%% ====================================================================