Executable is the path to the currently invoked binary
(executableName string)
| 410 | |
| 411 | // Executable is the path to the currently invoked binary |
| 412 | func 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 |