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