summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2014-12-21 14:47:32 -0500
committerFred Hebert <mononcqc@ferd.ca>2014-12-21 14:47:32 -0500
commit73676c80b06bd4a26040b41f42fee8dde536dcac (patch)
treef5212a45128a55dc91f9ae3dd8df5d5ae5a0ba41
parent676f2487adbdef87f3c31d0480e3113f91ca3bff (diff)
Fix up programmatic interface to rebar3
Now supports arbitrary commands
-rw-r--r--src/rebar3.erl6
-rw-r--r--test/rebar_compile_SUITE.erl2
-rw-r--r--test/rebar_deps_SUITE.erl2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/rebar3.erl b/src/rebar3.erl
index b325dc8..d4307f7 100644
--- a/src/rebar3.erl
+++ b/src/rebar3.erl
@@ -71,10 +71,10 @@ main(Args) ->
end.
%% Erlang-API entry point
-run(BaseState, Command) ->
+run(BaseState, Commands) ->
_ = application:load(rebar),
- BaseState1 = rebar_state:set(BaseState, task, Command),
- run_aux(BaseState1, [], [Command]).
+ BaseState1 = rebar_state:set(BaseState, task, Commands),
+ run_aux(BaseState1, [], Commands).
%% ====================================================================
%% Internal functions
diff --git a/test/rebar_compile_SUITE.erl b/test/rebar_compile_SUITE.erl
index 83b868d..03f9c1f 100644
--- a/test/rebar_compile_SUITE.erl
+++ b/test/rebar_compile_SUITE.erl
@@ -33,5 +33,5 @@ build_basic_app(Config) ->
Vsn = rebar_test_utils:create_random_vsn(),
rebar_test_utils:create_app(AppDir, Name, Vsn, [kernel, stdlib]),
- rebar_test_utils:run_and_check(Config, [], "compile", {ok, [{app, Name}]}).
+ rebar_test_utils:run_and_check(Config, [], ["compile"], {ok, [{app, Name}]}).
diff --git a/test/rebar_deps_SUITE.erl b/test/rebar_deps_SUITE.erl
index c6f24c0..d67efe4 100644
--- a/test/rebar_deps_SUITE.erl
+++ b/test/rebar_deps_SUITE.erl
@@ -195,7 +195,7 @@ circular_skip(Config) -> run(Config).
run(Config) ->
{ok, RebarConfig} = file:consult(?config(rebarconfig, Config)),
rebar_test_utils:run_and_check(
- Config, RebarConfig, "install_deps", ?config(expect, Config)
+ Config, RebarConfig, ["install_deps"], ?config(expect, Config)
),
check_warnings(warning_calls(), ?config(warnings, Config), ?config(deps_type, Config)).