MCPcopy Create free account
hub / github.com/go-task/task / ResolveDir

Method ResolveDir

taskfile/node_file.go:82–96  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

80}
81
82func (node *FileNode) ResolveDir(dir string) (string, error) {
83 path, err := execext.ExpandLiteral(dir)
84 if err != nil {
85 return "", err
86 }
87
88 if filepathext.IsAbs(path) {
89 return path, nil
90 }
91
92 // NOTE: Uses the directory of the entrypoint (Taskfile), not the current working directory
93 // This means that files are included relative to one another
94 entrypointDir := filepath.Dir(node.entrypoint)
95 return filepathext.SmartJoin(entrypointDir, path), nil
96}

Callers

nothing calls this directly

Calls 4

ExpandLiteralFunction · 0.92
IsAbsFunction · 0.92
SmartJoinFunction · 0.92
DirMethod · 0.65

Tested by

no test coverage detected