Open Avataw opened 6 months ago
This is actually already somewhat supported, provided there is a limit to how deep the folder tree goes, and assuming you give your template files a common extension.
- source: '{{ .file }}'
target: 'output/{{ .file | replace ".tmpl" "" }}'
with_files:
- 'templates/some_folder/*.tmpl'
- 'templates/some_folder/*/*.tmpl'
- 'templates/some_folder/*/*/*.tmpl'
- 'templates/some_folder/*/*/*/*.tmpl'
- 'templates/some_folder/*/*/*/*/*.tmpl'
Unfortunately, golang package filepath does not support **
in its Glob function, that's why you have to spell out the nesting levels, and it's limited to 4 directory levels I believe.
The feature is mentioned briefly in the readme, look for with_files
.
Support for ** would be great, though, so I'll keep this issue open. Will have to go on the lookout for a better Glob function than filepath.Glob.
Or we wait for https://github.com/golang/go/issues/11862 :)
It would be great to be able to recursively add a whole folder.
Something like: