diff options
Diffstat (limited to 'src/rlx_util.erl')
-rw-r--r-- | src/rlx_util.erl | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/rlx_util.erl b/src/rlx_util.erl index c1f7b38..7920379 100644 --- a/src/rlx_util.erl +++ b/src/rlx_util.erl @@ -299,15 +299,25 @@ cp_r_win32(Source,Dest) -> end, filelib:wildcard(Source)), ok. +%% @doc Returns the color intensity, we first check the application envorinment +%% if that is not set we check the environment variable RELX_COLOR. intensity() -> - case os:getenv("RELX_COLOR") of - "high" -> - high; - "low" -> - low; - _ -> - ?DFLT_INTENSITY + case application:get_env(relx, color_intensity) of + undefined -> + R = case os:getenv("RELX_COLOR") of + "high" -> + high; + "low" -> + low; + _ -> + ?DFLT_INTENSITY + end, + application:set_env(relx, color_intensity, R), + R; + Mode -> + Mode end. + %%%=================================================================== %%% Test Functions %%%=================================================================== |