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

Function resolveWorkspaceRoot

src/utils/workspace-identity.ts:10–20  ·  view source on GitHub ↗
(opts: { cwd: string; projectConfigPath?: string })

Source from the content-addressed store, hash-verified

8}
9
10export function resolveWorkspaceRoot(opts: { cwd: string; projectConfigPath?: string }): string {
11 if (opts.projectConfigPath) {
12 const configDir = dirname(opts.projectConfigPath);
13 return dirname(configDir);
14 }
15 try {
16 return realpathSync(opts.cwd);
17 } catch {
18 return opts.cwd;
19 }
20}
21
22function workspaceNameForRoot(workspaceRoot: string): string {
23 const rawName = basename(workspaceRoot) || 'workspace';

Callers 3

getSocketPathFunction · 0.90
resolveWorkspaceIdentityFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected