GetPathOrDefault gets the path for the given command. If it's not found, it will return the given value instead.
(command, def string)
| 16 | // GetPathOrDefault gets the path for the given command. |
| 17 | // If it's not found, it will return the given value instead. |
| 18 | func GetPathOrDefault(command, def string) string { |
| 19 | path, err := exec.LookPath(command) |
| 20 | if err != nil { |
| 21 | path = def |
| 22 | } |
| 23 | |
| 24 | return path |
| 25 | } |
no outgoing calls
no test coverage detected