From 393abe92d01040a847bfc42a80d61b33f0254ca7 Mon Sep 17 00:00:00 2001 From: Tristan Sloughter Date: Thu, 28 Aug 2014 09:17:01 -0500 Subject: use locks if exists --- src/rebar.erl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/rebar.erl') diff --git a/src/rebar.erl b/src/rebar.erl index 338e97b..01dca79 100644 --- a/src/rebar.erl +++ b/src/rebar.erl @@ -131,6 +131,13 @@ init_config({Options, _NonOptArgs}) -> rebar_config:consult_file(ConfigFile) end, + Config1 = case rebar_config:consult_file(?LOCK_FILE) of + [D] -> + [{locks, D} | Config]; + _ -> + Config + end, + %% If $HOME/.rebar/config exists load and use as global config GlobalConfigFile = filename:join([os:getenv("HOME"), ".rebar", "config"]), State = case filelib:is_regular(GlobalConfigFile) of @@ -138,9 +145,9 @@ init_config({Options, _NonOptArgs}) -> ?DEBUG("Load global config file ~p~n", [GlobalConfigFile]), rebar_config:consult_file(GlobalConfigFile), - rebar_state:new(GlobalConfigFile, Config); + rebar_state:new(GlobalConfigFile, Config1); false -> - rebar_state:new(Config) + rebar_state:new(Config1) end, %% Initialize vsn cache -- cgit v1.1