Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow skip template rendering for specific files #39

Closed
ilkka opened this issue Aug 28, 2023 · 5 comments · Fixed by #40
Closed

Allow skip template rendering for specific files #39

ilkka opened this issue Aug 28, 2023 · 5 comments · Fixed by #40
Assignees

Comments

@ilkka
Copy link
Contributor

ilkka commented Aug 28, 2023

Especially some recipes with Taskfiles can be tedious to create since every variable needs to be escaped in when rendering the recipe, like {{"{{.MY_TASK_VARIABLE}}"}}. To mitigate this, recipe could have skipRenderForFiles property which defines files which can be moved to project without rendering.

Special file extension could be used

@ilkka ilkka self-assigned this Aug 28, 2023
@ilkka
Copy link
Contributor Author

ilkka commented Aug 28, 2023

Doing this by only running templates that end in ".tmpl" through the templating, others get rendered as-is. Wondering if it's worth the trouble to rename the "templates" directory to "contents" or something?

@majori
Copy link
Member

majori commented Nov 28, 2023

I had an idea that could this be configured with a flag, so by default it renders all files, but with property something like explicitTemplates: true it renders only .tmpl files

@ilkka
Copy link
Contributor Author

ilkka commented Nov 28, 2023

Yeah, that sounds good. Another option could be a templateGlob that's just **/* by default, but could be narrowed to **/*.tmpl, but maybe it's unnecessarily generic.

@ilkka
Copy link
Contributor Author

ilkka commented Nov 28, 2023

Either of these could fix the logjam that is this branch right now, because I lost motivation when I realised this issue. Doing it like this totally bypasses the API contract thing.

@ilkka
Copy link
Contributor Author

ilkka commented Nov 30, 2023

...except the templateGlob does not work because if it's a freeform glob, how do we remove the template file ext? So maybe either templateExtor explicitTemplates like you suggested.

@ilkka ilkka closed this as completed in #40 Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants