diff options
-rw-r--r-- | src/rebar_templater.erl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl index 7a21e7d..9e2971c 100644 --- a/src/rebar_templater.erl +++ b/src/rebar_templater.erl @@ -254,6 +254,14 @@ execute_template([{dir, Name} | Rest], TemplateType, TemplateName, Context, Forc ?ABORT("Failed while processing template instruction {dir, ~s}: ~p\n", [Name, Reason]) end; +execute_template([{chmod, Mod, File} | Rest], TemplateType, TemplateName, Context, Force, ExistingFiles) when is_integer(Mod) -> + case file:change_mode(File, Mod) of + ok -> + execute_template(Rest, TemplateType, TemplateName, Context, Force, ExistingFiles); + {error, Reason} -> + ?ABORT("Failed while processing template instruction {cmod, ~b, ~s}: ~p~n", + [Mod, File, Reason]) + end; execute_template([{variables, _} | Rest], TemplateType, TemplateName, Context, Force, ExistingFiles) -> execute_template(Rest, TemplateType, TemplateName, Context, Force, ExistingFiles); execute_template([{file, Input, Output} | Rest], TemplateType, TemplateName, Context, Force, ExistingFiles) -> |