diff options
Diffstat (limited to 'src/rlx_util.erl')
-rw-r--r-- | src/rlx_util.erl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/rlx_util.erl b/src/rlx_util.erl index 9b86ad3..c4251d4 100644 --- a/src/rlx_util.erl +++ b/src/rlx_util.erl @@ -38,8 +38,10 @@ load_file/3, template_files/0, escript_foldl/3, + intensity/0, symlink_or_copy/2]). +-define(DFLT_INTENSITY, high). -define(ONE_LEVEL_INDENT, " "). %%============================================================================ %% types @@ -297,6 +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 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; + {ok, Mode} -> + Mode + end. + %%%=================================================================== %%% Test Functions %%%=================================================================== |