(source: string, target: string)
| 399 | } |
| 400 | |
| 401 | async function writeSymlink(source: string, target: string): Promise<void> { |
| 402 | try { |
| 403 | await fsp.symlink(source, target) |
| 404 | } catch (err) { |
| 405 | if ((err as NodeJS.ErrnoException).code === 'EEXIST') { |
| 406 | await fsp.rm(target, { force: true }) |
| 407 | await fsp.symlink(source, target) |
| 408 | return |
| 409 | } |
| 410 | throw err |
| 411 | } |
| 412 | } |
| 413 | |
| 414 | async function elevateAndSymlink(source: string, target: string): Promise<void> { |
| 415 | if (process.platform === 'darwin') { |