Q: Does a Taskfile permit inline subtasks? #739
-
Is something like the following possible: tasks:
sync:
tasks:
up: "rsync a b"
down: "rsync b a" with the aim of being able to do, e.g., |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
In short, yes. Check out the document for more information. tasks:
up:
cmds:
- echo "up"
down:
cmds:
- echo "down"
sync:
cmds:
- task: up
- task: down |
Beta Was this translation helpful? Give feedback.
-
I'm not sure what you mean by "sub-tasks", but you can declare tasks with names like Also, it's possible to forward extra arguments to a command by doing this: https://taskfile.dev/#/usage?id=forwarding-cli-arguments-to-commands |
Beta Was this translation helpful? Give feedback.
-
I think @andreynering's suggestion about just naming the tasks that way and hardcoding it is probably the most sensible approach for now. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
I'm not sure what you mean by "sub-tasks", but you can declare tasks with names like
docker:start
/docker:stop
/ etc (including an external Taskfile also does this automatically).Also, it's possible to forward extra arguments to a command by doing this: https://taskfile.dev/#/usage?id=forwarding-cli-arguments-to-commands