MCPcopy Index your code
hub / github.com/jetify-com/devbox / GetPathOrDefault

Function GetPathOrDefault

internal/cmdutil/cmdutil.go:18–25  ·  view source on GitHub ↗

GetPathOrDefault gets the path for the given command. If it's not found, it will return the given value instead.

(command, def string)

Source from the content-addressed store, hash-verified

16// GetPathOrDefault gets the path for the given command.
17// If it's not found, it will return the given value instead.
18func GetPathOrDefault(command, def string) string {
19 path, err := exec.LookPath(command)
20 if err != nil {
21 path = def
22 }
23
24 return path
25}

Callers 2

RunScriptFunction · 0.92
setSystemBinaryPathsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected