aboutsummaryrefslogtreecommitdiffstats
path: root/src/rlx_prv_config.erl
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2013-10-16 17:14:50 -0500
committerTristan Sloughter <[email protected]>2013-10-16 18:31:31 -0500
commitd6adddc25738be79c2663e410cc1ff45c14c23c7 (patch)
tree0caed1b01ffd66ed50d3e76198a15e5fde0a930b /src/rlx_prv_config.erl
parent5216cf94a3d2b62756a2acb2867449a782437bf9 (diff)
downloadrelx-d6adddc25738be79c2663e410cc1ff45c14c23c7.tar.gz
relx-d6adddc25738be79c2663e410cc1ff45c14c23c7.tar.bz2
relx-d6adddc25738be79c2663e410cc1ff45c14c23c7.zip
fix load overlay to support filename not in a list. This closes #74
Diffstat (limited to 'src/rlx_prv_config.erl')
-rw-r--r--src/rlx_prv_config.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rlx_prv_config.erl b/src/rlx_prv_config.erl
index b223bce..5f6dcad 100644
--- a/src/rlx_prv_config.erl
+++ b/src/rlx_prv_config.erl
@@ -177,7 +177,8 @@ load_terms({sys_config, SysConfig}, {ok, State}) ->
{ok, rlx_state:sys_config(State, filename:absname(SysConfig))};
load_terms({overlay_vars, OverlayVars}, {ok, State}) ->
CurrentOverlayVars = rlx_state:get(State, overlay_vars),
- NewOverlayVars = lists:umerge(lists:usort(OverlayVars), lists:usort(CurrentOverlayVars)),
+ NewOverlayVars = list_of_overlay_vars_files(OverlayVars),
+ NewOverlayVars = lists:umerge(lists:usort(NewOverlayVars), lists:usort(CurrentOverlayVars)),
{ok, rlx_state:put(State, overlay_vars, NewOverlayVars)};
load_terms({Name, Value}, {ok, State})
when erlang:is_atom(Name) ->
@@ -196,3 +197,12 @@ gen_providers(Providers, State) ->
(_, E={_, {error, _}}) ->
E
end, {[], {ok, State}}, Providers).
+
+list_of_overlay_vars_files(undefined) ->
+ [];
+list_of_overlay_vars_files([]) ->
+ [];
+list_of_overlay_vars_files([H | _]=FileNames) when erlang:is_list(H) ->
+ FileNames;
+list_of_overlay_vars_files(FileName) when is_list(FileName) ->
+ [FileName].