Feature request: Append to destination file #396
Replies: 2 comments
-
There is currently a modifyFile directive that is oriented around regex modifications. That could be used to append to a file I think. We could add an appendFile directive but one of the principles we've been trying to maintain is that you run the template on an existing directory and that would work reasonably well. Hence the modifyFile directive IIRC wouldn't modify a file if it detects the modifications are already in place. That said, we could allow for the same condition checking on an appendFile directive. |
Beta Was this translation helpful? Give feedback.
-
I'm thinking more along the lines of when I use a template like this:
Right now if I run Invoke-Plaster 3 times to create a Get-Foo, Set-Foo and Invoke-Foo, I end up with 3 separate files where ideally I'd like to put them all in a single ps1 or psm1 file. I can probably work around this with some tooling that would create the files then merge the contents into a single file. |
Beta Was this translation helpful? Give feedback.
-
So I've been trying out a manifest and template file to spin up a new PowerShell function works great and I can see the value. However, from what I can tell the only option is to put each function into its own file. Is there some way to append to a file on subsequent runs of a Plaster manifest?
Ideally I could invoke a Plaster manifest to scaffold out a new module and then run a manifest to sketch out the functions in a psm1 file.
Beta Was this translation helpful? Give feedback.
All reactions