* Find the first existing SSH key from default locations. * Resolves symlinks and returns the real path if found.
()
| 76 | * Resolves symlinks and returns the real path if found. |
| 77 | */ |
| 78 | function findDefaultSSHKey(): string | undefined { |
| 79 | for (const keyPath of DEFAULT_SSH_KEYS) { |
| 80 | const resolvedPath = resolveSymlink(keyPath); |
| 81 | if (isFile(resolvedPath)) { |
| 82 | return resolvedPath; |
| 83 | } |
| 84 | } |
| 85 | return undefined; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Parse SSH config file and extract configuration for a specific host |
no test coverage detected