task icon indicating copy to clipboard operation
task copied to clipboard

vars-based parallel tasks

Open dakom opened this issue 8 months ago • 1 comments

if I understand correctly, the only way to have a task run different commands in parallel, and cleanly exit when the task is killed, is by using the deps feature

however, I have a variable with a list of entries:

vars:
  FOO:
    apple
    banana
    orange

I can loop over these (and I do that for other requirements), but that runs each task serially. Afaict the map feature doesn't help - since the whole point is I want it to automatically work as new entries are added - i.e. manually adding FOO.1, FOO.2 doesn't quite solve it

What I currently have to do - manually - is something like this, which of course doesn't scale as more items are added to FOO, and also breaks if any typos are introduced:

deps: [
  "internal-apple",
  "internal-banana",
  "internal-foo",
]

Would it be possible to have some sort of expansion of variables? e.g. something like:

deps: [
  "internal-{{expand .FOO}}",
  "keep-adding-more-deps-why-not"
]

dakom avatar Jun 17 '24 11:06 dakom