Skip to content

Commit

Permalink
add config.script to support test w rebar2
Browse files Browse the repository at this point in the history
  • Loading branch information
uwiger committed Jun 24, 2016
1 parent b6f067f commit 72dbf43
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions rebar.config.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
%% -*- erlang-mode -*-
IsRebar3 = erlang:function_exported(rebar3, main, 1).

case IsRebar3 of
false ->
{_, Profs} = lists:keyfind(profiles, 1, CONFIG),
{_, Test} = lists:keyfind(test, 1, Profs),
{_, Deps} = lists:keyfind(deps, 1, Test),
{_, OrigDeps} = lists:keyfind(deps, 1, CONFIG),
lists:keyreplace(deps, 1, CONFIG, {deps, OrigDeps ++ Deps});
true ->
CONFIG
end.

0 comments on commit 72dbf43

Please sign in to comment.