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

Method ResolveEntrypoint

taskfile/node_git.go:189–201  ·  view source on GitHub ↗
(entrypoint string)

Source from the content-addressed store, hash-verified

187}
188
189func (node *GitNode) ResolveEntrypoint(entrypoint string) (string, error) {
190 // If the file is remote, we don't need to resolve the path
191 if IsRemoteEntrypoint(entrypoint) {
192 return entrypoint, nil
193 }
194
195 dir, _ := path.Split(node.path)
196 resolvedEntrypoint := fmt.Sprintf("%s//%s", node.url, path.Join(dir, entrypoint))
197 if node.ref != "" {
198 return fmt.Sprintf("%s?ref=%s", resolvedEntrypoint, node.ref), nil
199 }
200 return resolvedEntrypoint, nil
201}
202
203func (node *GitNode) ResolveDir(dir string) (string, error) {
204 path, err := execext.ExpandLiteral(dir)

Callers 5

TestGitNode_sshFunction · 0.95
TestGitNode_sshWithDirFunction · 0.95
TestGitNode_httpsFunction · 0.95
TestGitNode_httpsWithDirFunction · 0.95

Calls 1

IsRemoteEntrypointFunction · 0.85

Tested by 5

TestGitNode_sshFunction · 0.76
TestGitNode_sshWithDirFunction · 0.76
TestGitNode_httpsFunction · 0.76
TestGitNode_httpsWithDirFunction · 0.76