summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar_templater.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl
index fef4627..4abf404 100644
--- a/src/rebar_templater.erl
+++ b/src/rebar_templater.erl
@@ -397,6 +397,18 @@ execute_template(Files, [{'if', Cond, True, False} | Rest], TemplateType,
execute_template(Files, prepend_instructions(Instructions, Rest),
TemplateType, TemplateName, Context, Force,
ExistingFiles);
+execute_template(Files, [{'case', Variable, Values, Instructions} | Rest], TemplateType,
+ TemplateName, Context, Force, ExistingFiles) ->
+ {ok, Value} = dict:find(Variable, Context),
+ Instructions2 = case lists:member(Value, Values) of
+ true ->
+ Instructions;
+ _ ->
+ []
+ end,
+ execute_template(Files, prepend_instructions(Instructions2, Rest),
+ TemplateType, TemplateName, Context, Force,
+ ExistingFiles);
execute_template(Files, [{template, Input, Output} | Rest], TemplateType,
TemplateName, Context, Force, ExistingFiles) ->
InputName = filename:join(filename:dirname(TemplateName), Input),