aboutsummaryrefslogtreecommitdiffstats
path: root/src/rcl_state.erl
diff options
context:
space:
mode:
authorEric <[email protected]>2012-10-22 12:42:58 -0500
committerJordan Wilberding <[email protected]>2012-10-24 11:30:00 -0600
commitfa52e19b4990a17eb7efbafc0364c0c686d7b770 (patch)
treeaab84f35647d37fd8baabb5afab8967542887417 /src/rcl_state.erl
parent4b675b9c9681e49ce4d5c0eef8c152e36e93b1f8 (diff)
downloadrelx-fa52e19b4990a17eb7efbafc0364c0c686d7b770.tar.gz
relx-fa52e19b4990a17eb7efbafc0364c0c686d7b770.tar.bz2
relx-fa52e19b4990a17eb7efbafc0364c0c686d7b770.zip
fix error reporting when using the erlang API
Signed-off-by: Jordan Wilberding <[email protected]>
Diffstat (limited to 'src/rcl_state.erl')
-rw-r--r--src/rcl_state.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rcl_state.erl b/src/rcl_state.erl
index 23c7e74..c326df1 100644
--- a/src/rcl_state.erl
+++ b/src/rcl_state.erl
@@ -91,7 +91,7 @@ new(PropList, Targets) when erlang:is_list(PropList) ->
#state_t{log = proplists:get_value(log, PropList, rcl_log:new(error)),
output_dir=filename:absname(proplists:get_value(output_dir, PropList, "")),
lib_dirs=get_lib_dirs(proplists:get_value(lib_dirs, PropList, [])),
- config_files=Targets,
+ config_files=handle_configs(Targets),
goals=proplists:get_value(goals, PropList, []),
providers = [],
releases=ec_dictionary:new(ec_dict),
@@ -252,6 +252,18 @@ create_logic_providers(State0) ->
State4#state_t{providers=[ConfigProvider, DiscoveryProvider,
ReleaseProvider, AssemblerProvider]}.
+
+%% @doc explicitly handle single config file path
+-spec handle_configs(string() | [string()]) -> [string()].
+handle_configs(Configs = [Config | _])
+ when erlang:is_list(Config) ->
+ Configs;
+handle_configs(Config = [Char | _])
+ when erlang:is_integer(Char) ->
+ [Config];
+handle_configs([]) ->
+ [].
+
%%%===================================================================
%%% Test Functions
%%%===================================================================