summaryrefslogtreecommitdiff
path: root/src/rebar_config.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_config.erl')
-rw-r--r--src/rebar_config.erl14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/rebar_config.erl b/src/rebar_config.erl
index c858fef..b8222bc 100644
--- a/src/rebar_config.erl
+++ b/src/rebar_config.erl
@@ -57,7 +57,7 @@ consult_file(File) ->
{ok, Terms} = consult_and_eval(File, Script),
Terms;
false ->
- try_consult(File)
+ rebar_file_utils:try_consult(File)
end
end.
@@ -87,22 +87,12 @@ format_error({bad_dep_name, Dep}) ->
consult_and_eval(File, Script) ->
?DEBUG("Evaluating config script ~p", [Script]),
- StateData = try_consult(File),
+ StateData = rebar_file_utils:try_consult(File),
file:script(Script, bs([{'CONFIG', StateData}, {'SCRIPT', Script}])).
remove_script_ext(F) ->
filename:rootname(F, ".script").
-try_consult(File) ->
- case file:consult(File) of
- {ok, Terms} ->
- Terms;
- {error, enoent} ->
- [];
- {error, Reason} ->
- ?ABORT("Failed to read config file ~s:~n ~p", [File, Reason])
- end.
-
bs(Vars) ->
lists:foldl(fun({K,V}, Bs) ->
erl_eval:add_binding(K, V, Bs)