File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,9 @@ assert_config(Filename, Env) ->
257
257
case filelib :is_regular (Filename ) of
258
258
true ->
259
259
case file :consult (Filename ) of
260
- {ok , _ } -> ok ;
260
+ {ok , []} -> {error , " ERROR: Config file ~s should not be empty: ~s " };
261
+ {ok , [_ ]} -> ok ;
262
+ {ok , [_ |_ ]} -> {error , " ERROR: Config file ~s must contain ONE list ended by <dot>: ~s " };
261
263
{error , {1 , erl_parse , Err }} ->
262
264
{error , {" ERROR: Unable to parse erlang terms from ~s file: ~s~n "
263
265
" ERROR: Reason: ~p~n "
@@ -283,8 +285,9 @@ assert_conf(Filename, Env) ->
283
285
" .conf" = filename :extension (Filename ),
284
286
case filelib :is_regular (Filename ) of
285
287
true ->
286
- case file :read_file (Filename ) of
287
- {ok , <<" [" , _ /binary >>} ->
288
+ case file :consult (Filename ) of
289
+ {ok , []} -> ok ;
290
+ {ok , _ } ->
288
291
{error , {" ERROR: Wrong format of the config file ~s : ~s~n "
289
292
" ERROR: Check that the file is in the new ini-style config format "
290
293
" If you are using the old format the file extension should "
You can’t perform that action at this time.
0 commit comments