summaryrefslogtreecommitdiff
path: root/src/rebar_reltool.erl
diff options
context:
space:
mode:
authorJared Morrow <jared@basho.com>2014-05-21 15:36:57 -0600
committerJared Morrow <jared@basho.com>2014-05-21 15:36:57 -0600
commit755c6023d181b4aa87a581ac71e96d2de90a015f (patch)
tree59816f0f73785b5d75904b72036d1e2df3aa7834 /src/rebar_reltool.erl
parent618161b8d8b4636a207b299e46592e10bc01d569 (diff)
parent81ed1611af693fb9b4483a55c437a5c9d743966c (diff)
Merge pull request #52 from shino/slim-release-support
Slim release support
Diffstat (limited to 'src/rebar_reltool.erl')
-rw-r--r--src/rebar_reltool.erl33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/rebar_reltool.erl b/src/rebar_reltool.erl
index 9f9488e..fdaa7e0 100644
--- a/src/rebar_reltool.erl
+++ b/src/rebar_reltool.erl
@@ -147,15 +147,12 @@ process_overlay(Config, ReltoolConfig) ->
OverlayVars1),
%% Finally, overlay the files specified by the overlay section
- case lists:keyfind(overlay, 1, ReltoolConfig) of
- {overlay, Overlay} when is_list(Overlay) ->
+ case overlay_files(ReltoolConfig) of
+ [] ->
+ ok;
+ Overlay ->
execute_overlay(Overlay, OverlayVars, rebar_utils:get_cwd(),
- TargetDir);
- false ->
- ?INFO("No {overlay, [...]} found in reltool.config.\n", []);
- _ ->
- ?ABORT("{overlay, [...]} entry in reltool.config "
- "must be a list.\n", [])
+ TargetDir)
end.
%%
@@ -292,6 +289,26 @@ dump_spec(Config, Spec) ->
end.
+overlay_files(ReltoolConfig) ->
+ Original = case lists:keyfind(overlay, 1, ReltoolConfig) of
+ {overlay, Overlay} when is_list(Overlay) ->
+ Overlay;
+ false ->
+ ?INFO("No {overlay, [...]} found in reltool.config.\n", []),
+ [];
+ _ ->
+ ?ABORT("{overlay, [...]} entry in reltool.config "
+ "must be a list.\n", [])
+ end,
+ SlimAddition = case rebar_rel_utils:get_excl_lib_tuple(ReltoolConfig) of
+ {excl_lib, otp_root} ->
+ [{create, "releases/{{rel_vsn}}/runner_script.data",
+ "slim\n"}];
+ false ->
+ []
+ end,
+ Original ++ SlimAddition.
+
%% TODO: Merge functionality here with rebar_templater
execute_overlay([], _Vars, _BaseDir, _TargetDir) ->