add rebar.config.script to fall back to rebar2 style deps if using rebar2

This commit is contained in:
Tristan Sloughter 2015-10-31 17:46:06 -05:00
parent 8c1b1133de
commit 505d35996d
2 changed files with 16 additions and 1 deletions

15
rebar.config.script Normal file
View file

@ -0,0 +1,15 @@
{ok, VSN} = application:get_key(rebar, vsn),
[VSN1 | _] = string:tokens(VSN, "-"),
[Maj, Min, Patch] = string:tokens(VSN1, "."),
IsRebar3 = (list_to_integer(Maj) >= 3),
Rebar2Deps = [
{cf, ".*", {git, "https://github.com/project-fifo/cf", {tag, "0.2.0"}}}
],
case IsRebar3 of
true -> CONFIG;
false ->
lists:keyreplace(deps, 1, CONFIG, {deps, Rebar2Deps})
end.