Commit Graph

4 Commits

Author SHA1 Message Date
Pieter Noordhuis c71213ce56
Use filer for materializing template files 2024-11-18 22:29:58 +01:00
Pieter Noordhuis ca461bca57
Make 'persistToDisk' take a context argument 2024-11-18 22:29:58 +01:00
Pieter Noordhuis 4621079f71
Read template from [fs.FS] instead of assuming local paths
This removes the need to pre-materialize built-in templates.
2024-11-18 17:32:02 +01:00
shreyas-goenka fc8729d162
Only treat files with .tmpl extension as templates (#594)
## Changes
In a world before this PR, all files would be treated as `go text
templates`, making the content in these files quake in fear since they
would be executed (as a template).

This PR makes it so that only files with the `.tmpl` extension are
understood to be templates. This is useful for avoiding ambiguity in
cases like where a binary file could be interpreted as a go text
template otherwise.

In order to do so, we introduce the `copyFile` struct which does a copy
of the source file from the template without loading it into memory.

## Tests
Unit tests
2023-08-01 13:43:27 +00:00