MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / expandHomePrefix

Function expandHomePrefix

src/utils/path.ts:10–24  ·  view source on GitHub ↗
(inputPath: string)

Source from the content-addressed store, hash-verified

8 * and will be treated as literal path segments by `resolvePathFromCwd`.
9 */
10export function expandHomePrefix(inputPath: string): string {
11 if (!inputPath) {
12 return inputPath;
13 }
14
15 if (inputPath === '~') {
16 return homedir();
17 }
18
19 if (inputPath.startsWith('~/')) {
20 return path.join(homedir(), inputPath.slice(2));
21 }
22
23 return inputPath;
24}
25
26/**
27 * Resolve a user-supplied path: expand `~` then resolve against `cwd`

Callers 4

path.test.tsFile · 0.90
expandSnapshotPathFunction · 0.90
resolveCwdOverrideFunction · 0.90
resolvePathFromCwdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected