summaryrefslogtreecommitdiff
path: root/src/rebar_rel_utils.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/rebar_rel_utils.erl')
-rw-r--r--src/rebar_rel_utils.erl15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/rebar_rel_utils.erl b/src/rebar_rel_utils.erl
index bdf58d3..d9a1fc6 100644
--- a/src/rebar_rel_utils.erl
+++ b/src/rebar_rel_utils.erl
@@ -55,11 +55,16 @@ is_rel_dir(Dir) ->
end.
%% Get release name and version from a reltool.config
-get_reltool_release_info(ReltoolConfig) ->
- %% expect the first rel in the proplist to be the one you want
- {sys, Config} = get_sys_tuple(ReltoolConfig),
+get_reltool_release_info([{sys, Config}| _]) ->
{rel, Name, Ver, _} = proplists:lookup(rel, Config),
- {Name, Ver}.
+ {Name, Ver};
+get_reltool_release_info(ReltoolFile) when is_list(ReltoolFile) ->
+ case file:consult(ReltoolFile) of
+ {ok, ReltoolConfig} ->
+ get_reltool_release_info(ReltoolConfig);
+ _ ->
+ ?ABORT("Failed to parse ~s~n", [ReltoolFile])
+ end.
%% Get release name and version from a rel file
get_rel_release_info(RelFile) ->
@@ -170,4 +175,4 @@ make_proplist([H|T], Acc) ->
Ver = element(2, H),
make_proplist(T, [{App,Ver}|Acc]);
make_proplist([], Acc) ->
- Acc.
+ Acc. \ No newline at end of file