diff options
-rw-r--r-- | src/rebar_templater.erl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl index b8f7087..bca817f 100644 --- a/src/rebar_templater.erl +++ b/src/rebar_templater.erl @@ -385,6 +385,17 @@ 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, Value, Instructions} | Rest], TemplateType, + TemplateName, Context, Force, ExistingFiles) -> + Instructions2 = case dict:find(Variable, Context) of + {ok, Value} -> + 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), |