-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrebar.config.script
More file actions
25 lines (20 loc) · 905 Bytes
/
rebar.config.script
File metadata and controls
25 lines (20 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Conf0 = CONFIG,
NovaBranch = list_to_binary(os:getenv("NOVA_BRANCH", "master")),
NovaRepo = os:getenv("NOVA_REPO", "novaframework/nova"),
RepoUrl = "https://github.com/" ++ NovaRepo ++ ".git",
NovaDep = case NovaBranch of
<<"master">> ->
{nova, ".*", {git, RepoUrl, {branch, "master"}}};
<<"refs/tags/", Rest/binary>> ->
{nova, ".*", {git, RepoUrl, {tag, binary_to_list(Rest)}}};
NovaBranch ->
{nova, ".*", {git, RepoUrl, {branch, binary_to_list(NovaBranch)}}}
end,
%% Get existing deps from rebar.config (minus nova which we override)
ExistingDeps = case proplists:get_value(deps, Conf0) of
undefined -> [];
Deps0 -> [D || D <- Deps0, element(1, D) =/= nova]
end,
Deps = {deps, [NovaDep | ExistingDeps]},
Conf1 = proplists:delete(deps, Conf0),
[Deps|Conf1].