diff --git a/calculate/templates/template_processor.py b/calculate/templates/template_processor.py index c6aaf3d..5615473 100644 --- a/calculate/templates/template_processor.py +++ b/calculate/templates/template_processor.py @@ -328,7 +328,7 @@ class TemplateWrapper: elif self.target_is_link: if self.parameters.force: self.remove_original = True - else: + elif not self.parameters.append == "remove": try: link_source = check_directory_link( self.target_path, @@ -355,14 +355,15 @@ class TemplateWrapper: raise TemplateExecutorError("files error: {}". format(str(error))) elif self.target_is_link: - if self.target_type == DIR: - raise TemplateTypeConflict("the target file is a link to a" - " directory while the template" - " is a file") - else: - raise TemplateTypeConflict("the target file is a link to" - " a file while the template" - " is a file") + if not self.parameters.append == "remove": + if self.target_type == DIR: + raise TemplateTypeConflict("the target file is a link" + " to a directory while the" + " template is a file") + else: + raise TemplateTypeConflict("the target file is a link" + " to a file while the" + " template is a file") elif self.target_type == DIR: raise TemplateTypeConflict("the target file is a directory" " while the template is a file") diff --git a/tests/utils/testfiles/test_output5.png b/tests/utils/testfiles/test_output5.png new file mode 100644 index 0000000..08eaa7f Binary files /dev/null and b/tests/utils/testfiles/test_output5.png differ