Skip to content

Commit

Permalink
Add possibility to make symbolic links
Browse files Browse the repository at this point in the history
Simple feature, useful to make link to something without copying it.
  • Loading branch information
szemek authored and Tuncer Ayaz committed Oct 20, 2011
1 parent 176ec0e commit eb23571
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/rebar_templater.erl
Expand Up @@ -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,
Expand Down

0 comments on commit eb23571

Please sign in to comment.