()
| 2 | import process from 'node:process' |
| 3 | |
| 4 | function getOpenCommand() { |
| 5 | if (process.platform === 'darwin') { |
| 6 | return { command: 'open', args: [] } |
| 7 | } |
| 8 | |
| 9 | if (process.platform === 'win32') { |
| 10 | return { command: 'rundll32.exe', args: ['url.dll,FileProtocolHandler'] } |
| 11 | } |
| 12 | |
| 13 | return { command: 'xdg-open', args: [] } |
| 14 | } |
| 15 | |
| 16 | export async function openPathWithSystem(targetPath: string) { |
| 17 | const { command, args } = getOpenCommand() |
no outgoing calls
no test coverage detected