MCPcopy Index your code
hub / github.com/dagger/dagger / moduleLocalPathString

Method moduleLocalPathString

core/modtree.go:812–830  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

810}
811
812func (node *ModTreeNode) moduleLocalPathString() string {
813 path := node.Path()
814 if len(path) == 0 {
815 return ""
816 }
817
818 root := node
819 for root.Parent != nil && root.Parent.Module.Self() != nil {
820 root = root.Parent
821 }
822
823 // Workspace checks reparent each module tree under a synthetic naming-only
824 // root. Scale-out loads the module directly, so the remote check/generator
825 // lookup must use the name relative to that module.
826 if root.Parent != nil && root.Parent.Module.Self() == nil && path[0] == root.Name {
827 path = path[1:]
828 }
829 return strings.Join(path.CliCase(), ":")
830}
831
832type WalkFunc func(context.Context, *ModTreeNode) (bool, error)
833

Callers 3

tryRunCheckScaleOutMethod · 0.95

Calls 3

PathMethod · 0.95
SelfMethod · 0.80
CliCaseMethod · 0.80

Tested by 1