( url: string, platform: typeof process.platform = process.platform, )
| 323 | }; |
| 324 | |
| 325 | export const browserOpenCommand = ( |
| 326 | url: string, |
| 327 | platform: typeof process.platform = process.platform, |
| 328 | ): BrowserOpenCommand | undefined => { |
| 329 | const normalizedUrl = normalizeBrowserOpenUrl(url); |
| 330 | if (!normalizedUrl) return undefined; |
| 331 | if (platform === "darwin") return ["open", [normalizedUrl]]; |
| 332 | if (platform === "win32") return ["rundll32.exe", ["url.dll,FileProtocolHandler", normalizedUrl]]; |
| 333 | return ["xdg-open", [normalizedUrl]]; |
| 334 | }; |
| 335 | |
| 336 | /** Best-effort open the verification URL in the user's default browser. */ |
| 337 | export const openBrowser = (url: string): void => { |
no test coverage detected