MCPcopy Create free account
hub / github.com/bytebase/dbhub / resolveSymlink

Function resolveSymlink

src/utils/ssh-config-parser.ts:45–54  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

43 * @returns The resolved real path, or the expanded path if resolution fails
44 */
45export function resolveSymlink(filePath: string): string {
46 const expandedPath = expandTilde(filePath);
47 try {
48 return realpathSync(expandedPath);
49 } catch {
50 // If realpathSync fails (e.g., file doesn't exist),
51 // fall back to the expanded path
52 return expandedPath;
53 }
54}
55
56/**
57 * Check if a path points to an existing file.

Callers 4

loadPrivateKeyMethod · 0.85
findDefaultSSHKeyFunction · 0.85
parseSSHConfigFunction · 0.85

Calls 1

expandTildeFunction · 0.85

Tested by

no test coverage detected