summaryrefslogtreecommitdiff
path: root/src/rebar_relx.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_relx.erl')
-rw-r--r--src/rebar_relx.erl13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/rebar_relx.erl b/src/rebar_relx.erl
index 5d29258..5c653a3 100644
--- a/src/rebar_relx.erl
+++ b/src/rebar_relx.erl
@@ -14,6 +14,9 @@
-spec do(atom(), string(), atom(), rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}.
do(Module, Command, Provider, State) ->
+ %% We set the color mode for relx as a application env
+ application:set_env(relx, color_intensity, rebar_log:intensity()),
+ LogLevel = rebar_log:get_level(),
Options = rebar_state:command_args(State),
DepsDir = rebar_dir:deps_dir(State),
ProjectAppDirs = lists:delete(".", ?DEFAULT_PROJECT_APP_DIRS),
@@ -23,19 +26,21 @@ do(Module, Command, Provider, State) ->
AllOptions = string:join([Command | Options], " "),
Cwd = rebar_state:dir(State),
Providers = rebar_state:providers(State),
- rebar_hooks:run_all_hooks(Cwd, pre, Provider, Providers, State),
+ rebar_hooks:run_project_and_app_hooks(Cwd, pre, Provider, Providers, State),
try
case rebar_state:get(State, relx, []) of
[] ->
relx:main([{lib_dirs, LibDirs}
- ,{caller, api} | output_dir(OutputDir, Options)], AllOptions);
+ ,{caller, api}
+ ,{log_level, LogLevel} | output_dir(OutputDir, Options)], AllOptions);
Config ->
Config1 = merge_overlays(Config),
relx:main([{lib_dirs, LibDirs}
,{config, Config1}
- ,{caller, api} | output_dir(OutputDir, Options)], AllOptions)
+ ,{caller, api}
+ ,{log_level, LogLevel} | output_dir(OutputDir, Options)], AllOptions)
end,
- rebar_hooks:run_all_hooks(Cwd, post, Provider, Providers, State),
+ rebar_hooks:run_project_and_app_hooks(Cwd, post, Provider, Providers, State),
{ok, State}
catch
throw:T ->