* Resolves a file path, handling home directory expansion and relative paths
(settingsPath: string)
| 79 | * Resolves a file path, handling home directory expansion and relative paths |
| 80 | */ |
| 81 | function resolvePath(settingsPath: string): string { |
| 82 | // Handle home directory expansion |
| 83 | if (settingsPath.startsWith("~/")) { |
| 84 | return path.join(os.homedir(), settingsPath.slice(2)) |
| 85 | } |
| 86 | |
| 87 | // Handle absolute paths |
| 88 | if (path.isAbsolute(settingsPath)) { |
| 89 | return settingsPath |
| 90 | } |
| 91 | |
| 92 | // Handle relative paths (relative to home directory for safety) |
| 93 | return path.join(os.homedir(), settingsPath) |
| 94 | } |
no outgoing calls
no test coverage detected