MCPcopy Index your code
hub / github.com/go-task/task / ResolveEntrypoint

Method ResolveEntrypoint

taskfile/node_file.go:61–80  ·  view source on GitHub ↗
(entrypoint string)

Source from the content-addressed store, hash-verified

59}
60
61func (node *FileNode) ResolveEntrypoint(entrypoint string) (string, error) {
62 // If the file is remote, we don't need to resolve the path
63 if IsRemoteEntrypoint(entrypoint) {
64 return entrypoint, nil
65 }
66
67 path, err := execext.ExpandLiteral(entrypoint)
68 if err != nil {
69 return "", err
70 }
71
72 if filepathext.IsAbs(path) {
73 return path, nil
74 }
75
76 // NOTE: Uses the directory of the entrypoint (Taskfile), not the current working directory
77 // This means that files are included relative to one another
78 entrypointDir := filepath.Dir(node.entrypoint)
79 return filepathext.SmartJoin(entrypointDir, path), nil
80}
81
82func (node *FileNode) ResolveDir(dir string) (string, error) {
83 path, err := execext.ExpandLiteral(dir)

Callers

nothing calls this directly

Calls 5

ExpandLiteralFunction · 0.92
IsAbsFunction · 0.92
SmartJoinFunction · 0.92
IsRemoteEntrypointFunction · 0.85
DirMethod · 0.65

Tested by

no test coverage detected