Executable is the path to the currently invoked binary
(executableName string)
| 453 | |
| 454 | // Executable is the path to the currently invoked binary |
| 455 | func executablePath(executableName string) string { |
| 456 | ghPath := os.Getenv("GH_PATH") |
| 457 | if ghPath != "" { |
| 458 | return ghPath |
| 459 | } |
| 460 | |
| 461 | if strings.ContainsRune(executableName, os.PathSeparator) { |
| 462 | return executableName |
| 463 | } |
| 464 | |
| 465 | return executable(executableName) |
| 466 | } |
| 467 | |
| 468 | // Finds the location of the executable for the current process as it's found in PATH, respecting symlinks. |
| 469 | // If the process couldn't determine its location, return fallbackName. If the executable wasn't found in |