Path returns the absolute path to the gcloud command. If the command is not found it returns an error.
()
| 43 | // Path returns the absolute path to the gcloud command. If the command is not |
| 44 | // found it returns an error. |
| 45 | func Path() (string, error) { |
| 46 | g := "gcloud" |
| 47 | if runtime.GOOS == "windows" { |
| 48 | g = g + ".cmd" |
| 49 | } |
| 50 | return exec.LookPath(g) |
| 51 | } |
| 52 | |
| 53 | // configHelper implements oauth2.TokenSource via the `gcloud config config-helper` command. |
| 54 | type configHelper struct{} |