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

Method ResolveDir

taskfile/node_git.go:203–217  ·  view source on GitHub ↗
(dir string)

Source from the content-addressed store, hash-verified

201}
202
203func (node *GitNode) ResolveDir(dir string) (string, error) {
204 path, err := execext.ExpandLiteral(dir)
205 if err != nil {
206 return "", err
207 }
208
209 if filepathext.IsAbs(path) {
210 return path, nil
211 }
212
213 // NOTE: Uses the directory of the entrypoint (Taskfile), not the current working directory
214 // This means that files are included relative to one another
215 entrypointDir := filepath.Dir(node.Dir())
216 return filepathext.SmartJoin(entrypointDir, path), nil
217}
218
219func (node *GitNode) CacheKey() string {
220 checksum := strings.TrimRight(checksum([]byte(node.Location())), "=")

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