You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the public interface for using gomplete is in flux as it is moved to version 4 so this is likely a "it's not quite done yet" question.
The deprecated RunTemplates supports passing in InputDir and OutputDir which is super convenient when processing a directory since it builds the list of templates before calling the new gomplate.Renderer#RenderTemplates. This appears to be currently broken on gatherTemplates when cfg.InputDir != "" since the FSProvider is unset on the context.
Is the intent to have something similar to RunTemplates (or Run) with the new Renderer or should I enumerate the list of templates myself and provide it to RenderTemplates?
The text was updated successfully, but these errors were encountered:
In conceptRun replaces the deprecated RunTemplates function, but the Config type is still internal so it's not usable yet - that's the main thing blocking the v4.0.0 release, actually.
Another way to approach this that should work (?) is to use Renderer and handle the directory reading logic yourself. But keep in mind that it will likely change before v4.0.0 (NewRenderer is especially awkward to use right now as the Options type contains members that are actually non-optional)
If you don't mind I'm going to rename this issue and use it to track finalizing gomplate.Renderer before v4.0 😅
hairyhenderson
changed the title
gomplate.RunTemplates replacement
Need to finalize gomplate.Renderer and related types before v4.0.0
May 15, 2024
If Run is intended to be the replacement for RunTemplates, works for me - does exactly what I'm looking for! It currently breaks down here though since ctx is missing fsProviderCtxKey (ultimately in datafs.ResolveLocalPath).
RenderTemplatessolves this, but that's too late for Run. Happy to take a stab at a PR, just not quite sure what direction to take for this.
It looks like the public interface for using
gomplete
is in flux as it is moved to version 4 so this is likely a "it's not quite done yet" question.The deprecated
RunTemplates
supports passing inInputDir
andOutputDir
which is super convenient when processing a directory since it builds the list of templates before calling the newgomplate.Renderer#RenderTemplates
. This appears to be currently broken ongatherTemplates
whencfg.InputDir != ""
since theFSProvider
is unset on the context.Is the intent to have something similar to
RunTemplates
(orRun
) with the newRenderer
or should I enumerate the list of templates myself and provide it toRenderTemplates
?The text was updated successfully, but these errors were encountered: