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

Function resolveProjectFromSession

src/utils/infer-platform.ts:141–167  ·  view source on GitHub ↗
(params: InferPlatformParams)

Source from the content-addressed store, hash-verified

139}
140
141function resolveProjectFromSession(params: InferPlatformParams): {
142 projectPath?: string;
143 workspacePath?: string;
144 scheme?: string;
145} {
146 const defaults = params.sessionDefaults ?? sessionStore.getAll();
147 const hasExplicitProjectPath = params.projectPath !== undefined;
148 const hasExplicitWorkspacePath = params.workspacePath !== undefined;
149 const projectPath =
150 params.projectPath ?? (params.workspacePath ? undefined : defaults.projectPath);
151 const workspacePath =
152 params.workspacePath ?? (params.projectPath ? undefined : defaults.workspacePath);
153
154 if (projectPath && workspacePath && !hasExplicitProjectPath && !hasExplicitWorkspacePath) {
155 return {
156 projectPath: undefined,
157 workspacePath,
158 scheme: params.scheme ?? defaults.scheme,
159 };
160 }
161
162 return {
163 projectPath,
164 workspacePath,
165 scheme: params.scheme ?? defaults.scheme,
166 };
167}
168
169async function inferPlatformFromSimctl(
170 simulatorId: string | undefined,

Callers 1

inferPlatformFunction · 0.85

Calls 1

getAllMethod · 0.80

Tested by

no test coverage detected