Add possibility to make symbolic links

Simple feature, useful to make link to something without copying it.
This commit is contained in:
Przemysław Dąbek 2011-09-29 00:23:08 +02:00 committed by Tuncer Ayaz
parent 176ec0e71e
commit eb23571b8b

View file

@ -380,6 +380,16 @@ execute_template([{chmod, Mod, File} | Rest], TemplateType, TemplateName,
?ABORT("Failed while processing template instruction " ?ABORT("Failed while processing template instruction "
"{cmod, ~b, ~s}: ~p~n", [Mod, File, Reason]) "{cmod, ~b, ~s}: ~p~n", [Mod, File, Reason])
end; 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, execute_template([{variables, _} | Rest], TemplateType, TemplateName, Context,
Force, ExistingFiles) -> Force, ExistingFiles) ->
execute_template(Rest, TemplateType, TemplateName, execute_template(Rest, TemplateType, TemplateName,