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

Function Abs

engine/client/pathutil/pathutil.go:171–184  ·  view source on GitHub ↗

Abs returns an absolute representation of path, but handles case-insensitive filesystems as described in the comment on Getwd for the case where the path is relative and the cwd needs to be obtained

(path string)

Source from the content-addressed store, hash-verified

169// Abs returns an absolute representation of path, but handles case-insensitive filesystems as described in the comment
170// on Getwd for the case where the path is relative and the cwd needs to be obtained
171func Abs(path string) (string, error) {
172 if runtime.GOOS != "darwin" {
173 return filepath.Abs(path)
174 }
175
176 if filepath.IsAbs(path) {
177 return filepath.Clean(path), nil
178 }
179 cwd, err := Getwd()
180 if err != nil {
181 return "", err
182 }
183 return filepath.Join(cwd, path), nil
184}

Callers 6

normalizeWorkdirFunction · 0.92
module.goFile · 0.92
handleResponseFunction · 0.92
newWorkdirMethod · 0.92
NormalizeWorkdirFunction · 0.92

Calls 1

GetwdFunction · 0.85

Tested by

no test coverage detected