diff options
author | Heinz N. Gies <[email protected]> | 2016-02-16 11:58:04 -0500 |
---|---|---|
committer | Heinz N. Gies <[email protected]> | 2016-02-16 11:58:04 -0500 |
commit | 3ceb5594b249fba3e3cd26f6e76fd168f953c5c2 (patch) | |
tree | 86285643beb9aec08b4724b14c7496eff1354e98 /src | |
parent | 10e29bcb37f53c3dc4a0949660b8b0b1ed37cf1b (diff) | |
download | relx-3ceb5594b249fba3e3cd26f6e76fd168f953c5c2.tar.gz relx-3ceb5594b249fba3e3cd26f6e76fd168f953c5c2.tar.bz2 relx-3ceb5594b249fba3e3cd26f6e76fd168f953c5c2.zip |
Use an app_env to get color intensity
Diffstat (limited to 'src')
-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 %%%=================================================================== |