forked from zotonic/zotonic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rebar.config.script
50 lines (40 loc) · 1.48 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
47
48
49
50
%% Locate the optional extra checkouts directory
%% Add it to the project_app_dirs
CONFIG1 = case os:getenv("ZOTONIC_APPS") of
false ->
CONFIG;
"" ->
CONFIG;
"none" ->
AppsDir = filename:join("apps", "*"),
C1 = lists:keystore(project_app_dirs, 1, CONFIG, {project_app_dirs, [ AppsDir ]}),
ErlOpts = proplists:get_value(erl_opts, CONFIG, []),
ErlOpts1 = [ {i, AppsDir} | ErlOpts ],
C2 = lists:keystore(erl_opts, 1, C1, {erl_opts, ErlOpts1}),
io:format("Core Application Dirs:~n"),
lists:foreach(
fun(Dir) ->
io:format("- ~s~n", [Dir])
end,
proplists:get_value(project_app_dirs, C2, [])),
C2;
"apps_user" ->
CONFIG;
ZotonicApps ->
AppDir = proplists:get_value(project_app_dirs, CONFIG, []),
AppDir1 = [ filename:join(ZotonicApps, "*") | AppDir ],
C1 = lists:keystore(project_app_dirs, 1, CONFIG, {project_app_dirs, AppDir1}),
ErlOpts = proplists:get_value(erl_opts, CONFIG, []),
ErlOpts1 = [ {i, ZotonicApps} | ErlOpts ],
C2 = lists:keystore(erl_opts, 1, C1, {erl_opts, ErlOpts1}),
io:format("Application Dirs:~n"),
lists:foreach(
fun(Dir) ->
io:format("- ~s~n", [Dir])
end,
proplists:get_value(project_app_dirs, C2, [])),
C2
end,
% Version = os:cmd("git describe --tags"),
% file:write_file("VERSION", Version),
CONFIG1.