diff options
author | Tristan Sloughter <[email protected]> | 2016-02-16 11:51:01 -0600 |
---|---|---|
committer | Tristan Sloughter <[email protected]> | 2016-02-16 11:51:01 -0600 |
commit | b373b201e6d2c55333ef10de8db7c1d06fa65191 (patch) | |
tree | 310e157df4a595046ca96a9b87fad094f674186b /src/rlx_util.erl | |
parent | ef1921571bc5e4c3aec4d3b3f36b62efba01c3fd (diff) | |
parent | 0a029824e2d767b71f5f75f15b25861c49df1889 (diff) | |
download | relx-b373b201e6d2c55333ef10de8db7c1d06fa65191.tar.gz relx-b373b201e6d2c55333ef10de8db7c1d06fa65191.tar.bz2 relx-b373b201e6d2c55333ef10de8db7c1d06fa65191.zip |
Merge pull request #446 from project-fifo/arghv3.16.0
Add low / high color mode
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 %%%=================================================================== |