copier icon indicating copy to clipboard operation
copier copied to clipboard

WIP, add pre/post copy and pre/post update tasks

Open hahuang65 opened this issue 1 year ago • 4 comments
trafficstars

Hacking around for a potential solution to https://github.com/copier-org/copier/issues/240

Would love some feedback on whether we think this is a feasible solution or not.

If so, I need a little guidance on how to write some tests for the update tasks (they seem a bit difficult to test as we need to set up some Git repos), as well as how to test the difference between a pre and a post task.

hahuang65 avatar Feb 09 '24 05:02 hahuang65

thanks for the feedback @sisp!

Does _tasks already support templated code in it? To me, adding that may make the yaml file have less sections, but certainly adds complexity to the existing sections. More to maintain and more to test. I don't believe the syntax to be quite readable too.

It also makes it much more difficult to simply port an existing shell script into the _tasks section.

Those are just my thoughts. I'm happy to oblige with your design suggestion, especially if it's already been pre-established.

hahuang65 avatar Feb 13 '24 02:02 hahuang65

@hahuang65 Yes, _tasks supports templating already; see its docs.

As it turns out, #1510 is already adding the new, more convenient syntax not only for migrations but also for tasks. It might make sense to wait for it to be merged and then build this PR upon it.

sisp avatar Feb 13 '24 06:02 sisp

@hahuang65 If you're interested in continuing work on this PR, you may now build upon the implementation of #1510 that we just merged.

sisp avatar May 15 '24 09:05 sisp

@sisp exciting! Unfortunately, probably for the next 2 to 3 months I will be busy. If someone would like to take over, feel free. Otherwise, I'll re-visit in a few months.

hahuang65 avatar May 15 '24 15:05 hahuang65