Skip to content

Commit

Permalink
Remove els_config:consult_file/1
Browse files Browse the repository at this point in the history
  • Loading branch information
sirikid committed Dec 25, 2021
1 parent a9cbbb4 commit 91e64fc
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions apps/els_core/src/els_config.erl
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ try_yaml(Path) ->

-spec try_eterm(path(), boolean()) -> {ok, map()} | {error, atom(), term()}.
try_eterm(Path, TryYaml) ->
case consult_file(Path) of
case file:consult(Path) of
{ok, Config} ->
{ok, maps:from_list(Config)};
{error, _} when TryYaml ->
Expand All @@ -281,15 +281,6 @@ try_eterm(Path, TryYaml) ->
{error, error, Reason}
end.

-spec consult_file(path()) -> [map()] | {ok, [term()]} | {error, term()}.
consult_file(Path) ->
case string:find(Path, ".yaml", trailing) of
nomatch ->
file:consult(Path);
".yaml" ->
yamerl:decode_file(Path, [{map_node_format, map}])
end.

-spec report_missing_config() -> ok.
report_missing_config() ->
Msg =
Expand Down

0 comments on commit 91e64fc

Please sign in to comment.