Skip to content

Allow file template to take a string for the template instead of a file path. #203

@hulto

Description

@hulto

Writing the template file to disk
Reading it into file.template
Then writing to the dest is kinda complicated.
Would be easier to have something like:

template = assets.read("systemd-template.j2")
file.template(template, "/etc/systemd/service.conf", {service_name="abc", service_desc="xyz"})

Update the file.template function to take in a string instead of a file path and perform the template operation on the input string.

Instead of writing to a file on disk return the result of the templating as a string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions