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

Method ResolveDir

taskfile/node_http.go:150–168  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

148}
149
150func (node *HTTPNode) ResolveDir(dir string) (string, error) {
151 path, err := execext.ExpandLiteral(dir)
152 if err != nil {
153 return "", err
154 }
155
156 if filepathext.IsAbs(path) {
157 return path, nil
158 }
159
160 // NOTE: Uses the directory of the entrypoint (Taskfile), not the current working directory
161 // This means that files are included relative to one another
162 parent := node.Dir()
163 if node.Parent() != nil {
164 parent = node.Parent().Dir()
165 }
166
167 return filepathext.SmartJoin(parent, path), nil
168}
169
170func (node *HTTPNode) CacheKey() string {
171 checksum := strings.TrimRight(checksum([]byte(node.Location())), "=")

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected