diff options
author | Fred Hebert <mononcqc@ferd.ca> | 2015-05-22 14:34:46 -0400 |
---|---|---|
committer | Fred Hebert <mononcqc@ferd.ca> | 2015-05-22 14:34:46 -0400 |
commit | 5f577e2ab15d0aa3b6650f4e3d1ee086be3dc736 (patch) | |
tree | e7ae0873e879bf92ac9f9c51926f34781cab9d16 /src/rebar_config.erl | |
parent | b7acb56f4710fe3fd11163f6874f82f0008625b6 (diff) | |
parent | 476a80c33ee0d835e58eae3b3bb396eae401b9ec (diff) |
Merge pull request #470 from tsloughter/master
print and format error message for bad .app files and all bad configs
Diffstat (limited to 'src/rebar_config.erl')
-rw-r--r-- | src/rebar_config.erl | 14 |
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) |