MCPcopy Create free account
hub / github.com/docker-exec/dexec / RetrievePath

Function RetrievePath

util/util.go:60–67  ·  view source on GitHub ↗

RetrievePath takes an array whose first element may contain an overridden path and converts either this, or the default of "." to an absolute path using Go's file utilities. This is then passed to SanitisedPath with the current OS to get it into a Docker ready format.

(targetDirs []string)

Source from the content-addressed store, hash-verified

58// using Go's file utilities. This is then passed to SanitisedPath with the
59// current OS to get it into a Docker ready format.
60func RetrievePath(targetDirs []string) string {
61 path := "."
62 if len(targetDirs) > 0 {
63 path = targetDirs[0]
64 }
65 absPath, _ := filepath.Abs(path)
66 return SanitisePath(absPath, runtime.GOOS)
67}
68
69// AddPrefix takes a string slice and returns a new string slice
70// with the supplied prefix inserted before every string in the

Callers

nothing calls this directly

Calls 1

SanitisePathFunction · 0.85

Tested by

no test coverage detected