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

Function lookPath

internal/patchpkg/builder.go:452–458  ·  view source on GitHub ↗

lookPath is like [exec.lookPath], but first checks if there's an environment variable with the name prog. If there is, it returns $prog/bin/prog instead of consulting PATH. For example, lookPath would be able to find bash and patchelf in the following derivation: derivation { inherit (nixpkgs.

(prog string)

Source from the content-addressed store, hash-verified

450// builder = devbox;
451// }
452func lookPath(prog string) string {
453 pkgPath := os.Getenv(prog)
454 if pkgPath == "" {
455 return prog
456 }
457 return filepath.Join(pkgPath, "bin", prog)
458}
459
460func isExecutable(mode fs.FileMode) bool { return mode&0o111 != 0 }
461func isSymlink(mode fs.FileMode) bool { return mode&fs.ModeSymlink != 0 }

Callers 2

runMethod · 0.85
buildMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected