(url string)
| 166 | } |
| 167 | |
| 168 | func openbrowser(url string) error { |
| 169 | var cmd *exec.Cmd |
| 170 | |
| 171 | switch runtime.GOOS { |
| 172 | case "linux": |
| 173 | cmd = exec.Command("xdg-open", url) |
| 174 | case "windows": |
| 175 | cmd = exec.Command("rundll32", "url.dll,FileProtocolHandler", url) |
| 176 | case "darwin": |
| 177 | cmd = exec.Command("open", url) |
| 178 | default: |
| 179 | return fmt.Errorf("unsupported platform") |
| 180 | } |
| 181 | |
| 182 | if err := cmd.Start(); err != nil { |
| 183 | return err |
| 184 | } |
| 185 | |
| 186 | return cmd.Wait() |
| 187 | } |
| 188 | |
| 189 | // isRemoteSession returns true if the CLI is running inside an SSH session |
| 190 | // where a local browser callback would not be reachable. |
no test coverage detected