diff options
Diffstat (limited to 'src/rebar_prv_release.erl')
-rw-r--r-- | src/rebar_prv_release.erl | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/src/rebar_prv_release.erl b/src/rebar_prv_release.erl index 2eee367..b151bb5 100644 --- a/src/rebar_prv_release.erl +++ b/src/rebar_prv_release.erl @@ -3,7 +3,7 @@ -module(rebar_prv_release). --behaviour(rebar_provider). +-behaviour(provider). -export([init/1, do/1]). @@ -19,17 +19,24 @@ -spec init(rebar_state:t()) -> {ok, rebar_state:t()}. init(State) -> - State1 = rebar_state:add_provider(State, #provider{name = ?PROVIDER, - provider_impl = ?MODULE, - bare = false, - deps = ?DEPS, - example = "rebar release", - short_desc = "Build release of project.", - desc = "", - opts = []}), + State1 = rebar_state:add_provider(State, providers:create([{name, ?PROVIDER}, + {module, ?MODULE}, + {bare, false}, + {deps, ?DEPS}, + {example, "rebar release"}, + {short_desc, "Build release of project."}, + {desc, ""}, + {opts, []}])), {ok, State1}. -spec do(rebar_state:t()) -> {ok, rebar_state:t()} | {error, string()}. do(State) -> - relx:main(["release"]), + Options = rebar_state:command_args(State), + AllOptions = string:join(["release" | Options], " "), + case rebar_state:get(State, relx, []) of + [] -> + relx:main(AllOptions); + Config -> + relx:main([{config, Config}], AllOptions) + end, {ok, State}. |