MCPcopy
hub / github.com/go-task/task / Read

Method Read

taskfile/reader.go:249–260  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

247// building an [ast.TaskfileGraph] as it goes. If any errors occur, they will be
248// returned immediately.
249func (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
262func (r *Reader) debugf(format string, a ...any) {
263 if r.debugFunc != nil {

Callers

nothing calls this directly

Calls 2

includeMethod · 0.95
CleanGitCacheFunction · 0.85

Tested by

no test coverage detected