Check that default config files exist Avoid trying to load the default config files if they don't exist.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-config/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-config/commit/21dd1938 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-config/tree/21dd1938 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-config/diff/21dd1938 Branch: refs/heads/import Commit: 21dd1938ea3365dbce81f363678e27fa2ae35828 Parents: a6d02d5 Author: Paul J. Davis <paul.joseph.da...@gmail.com> Authored: Thu Feb 21 20:50:54 2013 -0600 Committer: Paul J. Davis <paul.joseph.da...@gmail.com> Committed: Thu Feb 21 20:50:54 2013 -0600 ---------------------------------------------------------------------- src/config_app.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-config/blob/21dd1938/src/config_app.erl ---------------------------------------------------------------------- diff --git a/src/config_app.erl b/src/config_app.erl index 8026b9b..54f2433 100644 --- a/src/config_app.erl +++ b/src/config_app.erl @@ -30,11 +30,12 @@ stop(_State) -> get_ini_files() -> Etc = filename:join(code:root_dir(), "etc"), Default = [filename:join(Etc,"default.ini"), filename:join(Etc,"local.ini")], + DefaultExists = lists:filter(fun filelib:is_file/1, Default), case init:get_argument(couch_ini) of error -> - Default; + DefaultExists; {ok, [[]]} -> - Default; + DefaultExists; {ok, [Values]} -> Values end.