* Gets the platform-specific command and arguments to open a URL.
(url: string)
| 34 | * Gets the platform-specific command and arguments to open a URL. |
| 35 | */ |
| 36 | function getOpenCommand(url: string): { command: string; args: string[] } { |
| 37 | switch (platform()) { |
| 38 | case 'darwin': |
| 39 | return { command: 'open', args: [url] } |
| 40 | case 'win32': |
| 41 | return { command: 'cmd', args: ['/c', 'start', '', url] } |
| 42 | default: |
| 43 | // Linux and other Unix-like systems |
| 44 | return { command: 'xdg-open', args: [url] } |
| 45 | } |
| 46 | } |