diff options
author | joewilliams <joe@joetify.com> | 2011-09-20 09:44:41 -0700 |
---|---|---|
committer | joewilliams <joe@joetify.com> | 2011-09-20 09:44:41 -0700 |
commit | cb5056b2e362aa0b1eb0ccfc6009613426682ed5 (patch) | |
tree | a1a7c429923bd139b27a64d4acdda069d92d38cc /src/rebar_rel_utils.erl | |
parent | 5998c6c721b22a9413c66f2b2b034f9d5bd5bb3d (diff) |
Get rid of app.config
app.config has been a long standing erroneous file in rebar. Erlang/OTP
documentation suggests a sys.config file instead. This file is stored in
the releases/VSN directory. This does a few things but most importantly
it ensures your config (contained in the application environment)
survives a hot upgrade. It also has the advantage of allowing the
configuration of the application to be versioned along side the
application code. This patch flips rebar to use sys.config rather than
app.config.
Additionally it makes this flip to vm.args as well, making them
versioned just like sys.config.
This patch also includes runner script changes to support the old
etc/app.config config file location and support for Windows.
Thanks to mokele for the initial work and kick in the pants to make this
finially happen.
Diffstat (limited to 'src/rebar_rel_utils.erl')
-rw-r--r-- | src/rebar_rel_utils.erl | 15 |
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 |