summaryrefslogtreecommitdiff
path: root/src/rebar_file_utils.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_file_utils.erl')
-rw-r--r--src/rebar_file_utils.erl15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/rebar_file_utils.erl b/src/rebar_file_utils.erl
index 437780d..6721b5a 100644
--- a/src/rebar_file_utils.erl
+++ b/src/rebar_file_utils.erl
@@ -72,11 +72,16 @@ consult_config(State, Filename) ->
[T] -> T;
[] -> []
end,
- SubConfigs = [consult_config(State, Entry ++ ".config") ||
- Entry <- Config, is_list(Entry)
- ],
-
- [Config | lists:merge(SubConfigs)].
+ JoinedConfig = lists:flatmap(
+ fun (SubConfig) when is_list(SubConfig) ->
+ case lists:suffix(".config", SubConfig) of
+ false -> consult_config(State, SubConfig ++ ".config");
+ true -> consult_config(State, SubConfig)
+ end;
+ (Entry) -> [Entry]
+ end, Config),
+ %% Backwards compatibility
+ [JoinedConfig].
format_error({bad_term_file, AppFile, Reason}) ->
io_lib:format("Error reading file ~s: ~s", [AppFile, file:format_error(Reason)]).