Read will read the Taskfile defined by the [Reader]'s [Node] and recurse through any [ast.Includes] it finds, reading each included Taskfile and building an [ast.TaskfileGraph] as it goes. If any errors occur, they will be returned immediately.
(ctx context.Context, node Node)
| 247 | // building an [ast.TaskfileGraph] as it goes. If any errors occur, they will be |
| 248 | // returned immediately. |
| 249 | func (r *Reader) Read(ctx context.Context, node Node) (*ast.TaskfileGraph, error) { |
| 250 | // Clean up git cache after reading all taskfiles |
| 251 | defer func() { |
| 252 | _ = CleanGitCache() |
| 253 | }() |
| 254 | |
| 255 | if err := r.include(ctx, node); err != nil { |
| 256 | return nil, err |
| 257 | } |
| 258 | |
| 259 | return r.graph, nil |
| 260 | } |
| 261 | |
| 262 | func (r *Reader) debugf(format string, a ...any) { |
| 263 | if r.debugFunc != nil { |
nothing calls this directly
no test coverage detected