diff options
author | Florent Gallaire <fgallaire@gmail.com> | 2013-12-06 06:51:29 +0100 |
---|---|---|
committer | Florent Gallaire <fgallaire@gmail.com> | 2013-12-11 14:10:21 +0100 |
commit | 51584caa3e2fc6012a3ce4229751704067cae254 (patch) | |
tree | f52aa63553e66bd4af1cdfa03891dae72bcb3eec /src | |
parent | 0e39dc4149e2876649560f43730a34cccda9493c (diff) |
A switch variable can have multiple values
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_templater.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl index bca817f..279c53d 100644 --- a/src/rebar_templater.erl +++ b/src/rebar_templater.erl @@ -385,10 +385,11 @@ 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, +execute_template(Files, [{'case', Variable, Values, Instructions} | Rest], TemplateType, TemplateName, Context, Force, ExistingFiles) -> - Instructions2 = case dict:find(Variable, Context) of - {ok, Value} -> + {ok, Value} = dict:find(Variable, Context), + Instructions2 = case lists:member(Value, Values) of + true -> Instructions; _ -> [] |