* Expand tilde (~) in file paths to home directory
(filePath: string)
| 29 | * Expand tilde (~) in file paths to home directory |
| 30 | */ |
| 31 | function expandTilde(filePath: string): string { |
| 32 | if (filePath.startsWith('~/')) { |
| 33 | return join(homedir(), filePath.substring(2)); |
| 34 | } |
| 35 | return filePath; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Resolve a path, following symlinks if necessary. |