MCPcopy Create free account
hub / github.com/cli/cli / executablePath

Function executablePath

internal/ghcmd/cmd.go:427–438  ·  view source on GitHub ↗

Executable is the path to the currently invoked binary

(executableName string)

Source from the content-addressed store, hash-verified

425
426// Executable is the path to the currently invoked binary
427func executablePath(executableName string) string {
428 ghPath := os.Getenv("GH_PATH")
429 if ghPath != "" {
430 return ghPath
431 }
432
433 if strings.ContainsRune(executableName, os.PathSeparator) {
434 return executableName
435 }
436
437 return executable(executableName)
438}
439
440// Finds the location of the executable for the current process as it's found in PATH, respecting symlinks.
441// 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