aboutsummaryrefslogtreecommitdiffstats
path: root/src/rcl_state.erl
diff options
context:
space:
mode:
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
%%%===================================================================