summaryrefslogtreecommitdiff
path: root/src/rebar_utils.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2016-06-11 18:47:47 -0400
committerGitHub <noreply@github.com>2016-06-11 18:47:47 -0400
commitcaaa4be10de29db59ff94949ba6ef7312b7feb8d (patch)
treedb25e5c5078769f8af3f9ae839365ac7758ade83 /src/rebar_utils.erl
parente337793e9fda77462d5d5dec7ed0fa3fd11483d7 (diff)
parent854abc1bda6457ababae18d115e2aed26cce6405 (diff)
Merge pull request #1231 from tsloughter/ct_sys_config
add support for passing a sys_config to common test
Diffstat (limited to 'src/rebar_utils.erl')
-rw-r--r--src/rebar_utils.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rebar_utils.erl b/src/rebar_utils.erl
index ce6996c..aa9e268 100644
--- a/src/rebar_utils.erl
+++ b/src/rebar_utils.erl
@@ -69,7 +69,8 @@
check_blacklisted_otp_versions/1,
info_useless/2,
list_dir/1,
- user_agent/0]).
+ user_agent/0,
+ reread_config/1]).
%% for internal use only
-export([otp_release/0]).
@@ -412,6 +413,17 @@ user_agent() ->
{ok, Vsn} = application:get_key(rebar, vsn),
?FMT("Rebar/~s (OTP/~s)", [Vsn, otp_release()]).
+reread_config(ConfigList) ->
+ try
+ [application:set_env(Application, Key, Val)
+ || Config <- ConfigList,
+ {Application, Items} <- Config,
+ {Key, Val} <- Items]
+ catch _:_ ->
+ ?ERROR("The configuration file submitted could not be read "
+ "and will be ignored.", [])
+ end.
+
%% ====================================================================
%% Internal functions
%% ====================================================================