MCPcopy Index your code
hub / github.com/cli/cli / executablePath

Function executablePath

internal/ghcmd/cmd.go:412–423  ·  view source on GitHub ↗

Executable is the path to the currently invoked binary

(executableName string)

Source from the content-addressed store, hash-verified

410
411// Executable is the path to the currently invoked binary
412func executablePath(executableName string) string {
413 ghPath := os.Getenv("GH_PATH")
414 if ghPath != "" {
415 return ghPath
416 }
417
418 if strings.ContainsRune(executableName, os.PathSeparator) {
419 return executableName
420 }
421
422 return executable(executableName)
423}
424
425// Finds the location of the executable for the current process as it's found in PATH, respecting symlinks.
426// If the process couldn't determine its location, return fallbackName. If the executable wasn't found in

Callers 2

TestExecutablePathFunction · 0.85
MainFunction · 0.85

Calls 1

executableFunction · 0.70

Tested by 1

TestExecutablePathFunction · 0.68