Executable is the path to the currently invoked binary
(executableName string)
| 425 | |
| 426 | // Executable is the path to the currently invoked binary |
| 427 | func 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 |