Skip to content

Commit e414185

Browse files
committed
Add tilde expansion to build-settings.ts resolvePathFromCwd
The duplicate resolvePathFromCwd in build-settings.ts was missing tilde expansion. This caused derivedDataPath with ~ to work during builds but fail when resolving app paths from build settings (used by build_run_device and get_device_app_path).
1 parent e5ccde9 commit e414185

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/mcp/tools/device/build-settings.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from 'node:path';
2+
import { homedir } from 'node:os';
23
import { XcodePlatform } from '../../../types/common.ts';
34
import type { CommandExecutor } from '../../../utils/execution/index.ts';
45

@@ -7,6 +8,14 @@ function resolvePathFromCwd(pathValue?: string): string | undefined {
78
return undefined;
89
}
910

11+
if (pathValue === '~') {
12+
return homedir();
13+
}
14+
15+
if (pathValue.startsWith('~/')) {
16+
return path.join(homedir(), pathValue.slice(2));
17+
}
18+
1019
if (path.isAbsolute(pathValue)) {
1120
return pathValue;
1221
}

0 commit comments

Comments
 (0)