(shellServer: ShellServer, location: string)
| 554 | } |
| 555 | |
| 556 | export async function isFile(shellServer: ShellServer, location: string) { |
| 557 | return platformDispatch(shellServer.platform, { |
| 558 | posix: async () => { |
| 559 | try { |
| 560 | await shellServer.exec(`test -f '${location}'`); |
| 561 | return true; |
| 562 | } catch (err) { |
| 563 | return false; |
| 564 | } |
| 565 | }, |
| 566 | win32: async () => { |
| 567 | return (await shellServer.exec(`Test-Path '${location}' -PathType Leaf`)) |
| 568 | .stdout.trim() === 'True'; |
| 569 | } |
| 570 | })(); |
| 571 | } |
| 572 | |
| 573 | let localUsername: Promise<string>; |
| 574 | export async function getLocalUsername() { |
no test coverage detected