aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric B Merritt <[email protected]>2013-02-05 16:49:41 -0800
committerEric B Merritt <[email protected]>2013-02-05 17:10:45 -0800
commit26851a2e1c59124dea325e9a38cda25da463839a (patch)
treed160929e396a69086de2b5ac9af1685c15270ffc
parent882d4fbfe65dfc812d3de9d55647f9fb468be4b4 (diff)
downloadrelx-26851a2e1c59124dea325e9a38cda25da463839a.tar.gz
relx-26851a2e1c59124dea325e9a38cda25da463839a.tar.bz2
relx-26851a2e1c59124dea325e9a38cda25da463839a.zip
fix config issues with undefined config
-rw-r--r--src/rcl_prv_config.erl4
-rw-r--r--src/rcl_state.erl8
2 files changed, 6 insertions, 6 deletions
diff --git a/src/rcl_prv_config.erl b/src/rcl_prv_config.erl
index 5d51300..60655b1 100644
--- a/src/rcl_prv_config.erl
+++ b/src/rcl_prv_config.erl
@@ -46,9 +46,9 @@ init(State) ->
-spec do(rcl_state:t()) ->{ok, rcl_state:t()} | relcool:error().
do(State) ->
case rcl_state:config_file(State) of
- [] ->
+ undefined ->
search_for_dominating_config(State);
- ConfigFile ->
+ ConfigFile when erlang:is_list(ConfigFile) ->
load_config(ConfigFile, State)
end.
diff --git a/src/rcl_state.erl b/src/rcl_state.erl
index ecf3115..149b5ab 100644
--- a/src/rcl_state.erl
+++ b/src/rcl_state.erl
@@ -65,7 +65,7 @@
action :: atom(),
output_dir :: file:name(),
lib_dirs=[] :: [file:name()],
- config_file=[] :: file:filename(),
+ config_file=[] :: file:filename() | undefined,
goals=[] :: [rcl_depsolver:constraint()],
providers = [] :: [rcl_provider:t()],
available_apps = [] :: [rcl_app_info:t()],
@@ -102,7 +102,7 @@ new(PropList, Target)
#state_t{log = proplists:get_value(log, PropList, rcl_log:new(error)),
output_dir=proplists:get_value(output_dir, PropList, ""),
lib_dirs=proplists:get_value(lib_dirs, PropList, ""),
- config_file=proplists:get_value(config, PropList, ""),
+ config_file=proplists:get_value(config, PropList, undefined),
action = Target,
goals=proplists:get_value(goals, PropList, []),
providers = [],
@@ -143,11 +143,11 @@ lib_dirs(#state_t{lib_dirs=LibDir}) ->
goals(#state_t{goals=TS}) ->
TS.
--spec config_file(t()) -> file:filename().
+-spec config_file(t()) -> file:filename() | undefined.
config_file(#state_t{config_file=ConfigFiles}) ->
ConfigFiles.
--spec config_file(t(), file:filename()) -> t().
+-spec config_file(t(), file:filename() | undefined) -> t().
config_file(State, ConfigFiles) ->
State#state_t{config_file=ConfigFiles}.