summaryrefslogtreecommitdiff
path: root/src/rebar_templater.erl
diff options
context:
space:
mode:
authorPrzemysław Dąbek <przemyslaw.dabek@gmail.com>2011-09-29 00:23:08 +0200
committerTuncer Ayaz <tuncer.ayaz@gmail.com>2011-10-20 20:29:16 +0200
commiteb23571b8b217ff562b3f4e5d6bfd154532ebb5d (patch)
tree17eb3483bbcebb050c8d34114e758f10be2f07c3 /src/rebar_templater.erl
parent176ec0e71e37c53b541cd1eed1abd04206b97199 (diff)
Add possibility to make symbolic links
Simple feature, useful to make link to something without copying it.
Diffstat (limited to 'src/rebar_templater.erl')
-rw-r--r--src/rebar_templater.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rebar_templater.erl b/src/rebar_templater.erl
index 5fe427b..d5709c3 100644
--- a/src/rebar_templater.erl
+++ b/src/rebar_templater.erl
@@ -380,6 +380,16 @@ execute_template([{chmod, Mod, File} | Rest], TemplateType, TemplateName,
?ABORT("Failed while processing template instruction "
"{cmod, ~b, ~s}: ~p~n", [Mod, File, Reason])
end;
+execute_template([{symlink, Target, LinkName} | Rest], TemplateType, TemplateName,
+ Context, Force, ExistingFiles) ->
+ case file:make_symlink(Target, LinkName) of
+ ok ->
+ execute_template(Rest, TemplateType, TemplateName,
+ Context, Force, ExistingFiles);
+ {error, Reason} ->
+ ?ABORT("Failed while processing template instruction "
+ "{symlink, ~s, ~s}: ~p~n", [Target, LinkName, Reason])
+ end;
execute_template([{variables, _} | Rest], TemplateType, TemplateName, Context,
Force, ExistingFiles) ->
execute_template(Rest, TemplateType, TemplateName,