-
Notifications
You must be signed in to change notification settings - Fork 8
/
rebar.config.script
46 lines (46 loc) · 1.52 KB
/
rebar.config.script
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
%% -*- erlang -*-
Script = fun(D,S,Vs) ->
Scr = filename:join(D, S),
case file:script(Scr, orddict:store('SCRIPT', Scr, Vs)) of
{ok, Res} -> Res;
{error,_} = Err ->
io:fwrite("Error evaluating script ~s~n", [S]),
Err
end
end.
CFG1 = case os:getenv("REBAR_DEPS") of
false -> CONFIG;
[] -> CONFIG;
Dir -> lists:keystore(deps_dir, 1, CONFIG, {deps_dir, Dir})
end.
Priv = filename:join(filename:dirname(SCRIPT), "priv/scripts").
CFG2 = case os:getenv("WEST_DIST") of
"true" ->
CFG1;
F when F=="false"; F==false ->
Script(Priv,
"remove_deps.script",
[{'CONFIG', CFG1}, {'DEPS', [riak_core]}])
end.
CFG3 = case os:getenv("WEST_YAWS") of
"true" ->
CFG2;
F when F=="false"; F==false ->
Script(Priv,
"remove_deps.script",
[{'CONFIG', CFG2}, {'DEPS', [yaws]}])
end.
CFG4 = case os:getenv("WEST_COWBOY") of
"false" ->
Script(Priv,
"remove_deps.script",
[{'CONFIG', CFG3}, {'DEPS', [cowboy]}]);
F when F=="true"; F==false ->
CFG3
end.
CFG5 = case os:getenv("WEST_ALL") of
"true" ->
CFG1;
F when F=="false"; F==false ->
CFG4
end.