( absolutePath: string, isDirectory: boolean | undefined, platform: NodeJS.Platform, )
| 151 | } |
| 152 | |
| 153 | function openInFinder( |
| 154 | absolutePath: string, |
| 155 | isDirectory: boolean | undefined, |
| 156 | platform: NodeJS.Platform, |
| 157 | ): LaunchCommand { |
| 158 | switch (platform) { |
| 159 | case 'darwin': |
| 160 | return isDirectory |
| 161 | ? { command: 'open', args: [absolutePath] } |
| 162 | : { command: 'open', args: ['-R', absolutePath] }; |
| 163 | case 'win32': |
| 164 | return isDirectory |
| 165 | ? { command: 'explorer.exe', args: [absolutePath] } |
| 166 | : { command: 'explorer.exe', args: [`/select,${absolutePath}`] }; |
| 167 | default: |
| 168 | return { |
| 169 | command: 'xdg-open', |
| 170 | args: [isDirectory ? absolutePath : path.dirname(absolutePath)], |
| 171 | }; |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | function openInMacApp( |
| 176 | appName: string, |
no outgoing calls
no test coverage detected