Skip to content

Commit 5870d17

Browse files
author
Johan van Overbeeke
committed
Tighten up SubTaskfile description
1 parent 77cb8c1 commit 5870d17

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

README.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,20 +85,20 @@ Now after running `task shorthand`, your `task` commands will get autocompleted.
8585

8686
## SubTaskfiles
8787

88-
Have a (mono)repo with multiple projects, a group of less-used or specialized tasks or just waaay to many tasks for a
89-
single Taskfile? Splitting your Taskfile might be for you! Using SubTaskfiles allows you to divide your tasks across
90-
multiple files while still calling them from a single entrypoint (a familiar, regular Taskfile). Most useful for
91-
splitting off a group of tasks that can be logically grouped together, like for specific use-cases or because they are
92-
rarely used.
88+
SubTaskfiles allow you to divide your tasks across multiple files while still calling them from a single entrypoint
89+
(a familiar, regular Taskfile).
9390

94-
Example use-cases: git-hooks, frontend- / backend-specific tasks, tasks that fix (infrequently occurring) bugs, etc.
91+
Use them to split off groups of tasks that can be logically grouped together, like for specific use-cases or because they are rarely
92+
used. For example: git-hooks, frontend- / backend-specific tasks, tasks for (infrequently occurring) procedures,
93+
CI-only tasks, etc.
9594

96-
Tasks in SubTaskfiles are not called directly, but "via" a task in the root Taskfile, like this:
95+
Tasks in SubTaskfiles are never called directly, but "via" a task in the root Taskfile, like this:
9796
`Usage: ./Taskfile foo <task> <args>`
9897

9998
### How
10099

101100
Put this in the root Taskfile:
101+
102102
```shell
103103
function task:foo { ## bar
104104
SUBTASKFILE_DIR="./path/to/subtaskfile/"
@@ -114,8 +114,10 @@ function task:baz { ## Call `foo baz` directly
114114
}
115115
```
116116

117-
Give the SubTaskfile the filename `SubTaskfile`. It needs to contain only the tasks and sections you think useful (while
118-
still having access to stuff like `file:ensure` from the root Taskfile!), but it has a few notes:
117+
Create a file named `SubTaskfile` in a relevant location. It should only contain the tasks and sections you think useful
118+
for that location (as utility stuff like `task:help`, `BLUE` env vars, `file:ensure`, etc. are provided by the root
119+
Taskfile), and has a few notes:
120+
119121
```shell
120122
# When you refer to files in the SubTaskfile's directory, you need prefix them with $SUBTASKFILE_DIR
121123
function task:call-script { ## Call a script

0 commit comments

Comments
 (0)