Support cmds
in for
loops
#1543
simonrouse9461
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
This would really clean up a lot boilerplate. Even better would be to support nested for. I have typical scenarios where I loop over ENVIRONMENTS, then TENANTS, then SECRETS. It works, but its a lot noise. |
Beta Was this translation helpful? Give feedback.
0 replies
-
You probably should communicate better why you need version: '3'
tasks:
one-task:
cmd:
for: [a, b, c]
cmd: |
echo {{.ITEM}} 1
echo {{.ITEM}} 2 $ go-task one-task
task: [one-task] echo a 1
echo a 2
a 1
a 2
task: [one-task] echo b 1
echo b 2
b 1
b 2
task: [one-task] echo c 1
echo c 2
c 1
c 2 The trick is the YAML multi-line string feature with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, if I want to run multiple commands in a for loop, I have to define a separate task,
However, sometimes it's not convenient and doesn't worth it to define a separate task for just a few commands. I would prefer something like this,
This makes for loops much easier to use. Is there any specific reason why this is not allowed?
Beta Was this translation helpful? Give feedback.
All reactions