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

Function expandTilde

src/utils/ssh-config-parser.ts:31–36  ·  view source on GitHub ↗

* Expand tilde (~) in file paths to home directory

(filePath: string)

Source from the content-addressed store, hash-verified

29 * Expand tilde (~) in file paths to home directory
30 */
31function 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.

Callers 1

resolveSymlinkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected