Skip to content

Document sanitizing of text in Append task #1673

@jawira

Description

@jawira

I'm trying to add a final new line at the end of a file. I tried to do so with AppendTask.

<append destFile="my-file.txt" text="${line.separator}"/>

The problem is this doesn't work because text is "sanitized" after:

private function sanitizeText(): void
{
if (null !== $this->text && '' === trim($this->text)) {
$this->text = null;
}
}

I don't understand the rationale behind sanitizeText. But IMHO this method can be deleted, or maybe there's another way to simply append a new line ?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions