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

Method contextAbsPath

cmd/dagger/shell_fs.go:561–573  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

559}
560
561func (h *shellCallHandler) contextAbsPath(path string) (string, error) {
562 if !filepath.IsAbs(path) {
563 path = filepath.Join(h.workdirPath(), path)
564
565 // path could be empty if input is empty and workdir is "/"
566 if path != "" && !filepath.IsLocal(path) {
567 return "", fmt.Errorf("can't escape context root: %s", h.contextRoot())
568 }
569
570 path = filepath.Join("/", path)
571 }
572 return path, nil
573}
574
575func (h *shellCallHandler) workdirPath() string {
576 return strings.TrimPrefix(h.workdirAbsPath(), "/")

Callers 6

contextModRefMethod · 0.95
contextArgRefMethod · 0.95
parseModRefMethod · 0.95
newWorkdirMethod · 0.95
DirectoryMethod · 0.95
FileMethod · 0.95

Calls 2

workdirPathMethod · 0.95
contextRootMethod · 0.95

Tested by

no test coverage detected