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

Function loadProjectConfig

src/utils/project-config.ts:294–341  ·  view source on GitHub ↗
(
  options: LoadProjectConfigOptions,
)

Source from the content-addressed store, hash-verified

292}
293
294export async function loadProjectConfig(
295 options: LoadProjectConfigOptions,
296): Promise<LoadProjectConfigResult> {
297 const configPath = getConfigPath(options.cwd);
298
299 if (!options.fs.existsSync(configPath)) {
300 return { found: false };
301 }
302
303 try {
304 const rawText = await options.fs.readFile(configPath, 'utf8');
305 const parsed = parseProjectConfig(rawText);
306 const notices: string[] = [];
307
308 let config = normalizeDebuggerBackend(parsed);
309
310 if (parsed.enabledWorkflows !== undefined) {
311 const normalizedWorkflows = normalizeEnabledWorkflows(parsed.enabledWorkflows);
312 config = { ...config, enabledWorkflows: normalizedWorkflows };
313 }
314 if (parsed.customWorkflows !== undefined) {
315 const normalizedCustomWorkflows = normalizeCustomWorkflows(parsed.customWorkflows);
316 config = { ...config, customWorkflows: normalizedCustomWorkflows };
317 }
318
319 if (config.sessionDefaults) {
320 const normalized = normalizeMutualExclusivity(config.sessionDefaults);
321 notices.push(...normalized.notices);
322 const resolved = resolveRelativeSessionPaths(normalized.normalized, options.cwd);
323 config = { ...config, sessionDefaults: resolved };
324 }
325
326 if (config.sessionDefaultsProfiles) {
327 const normalizedProfiles = normalizeSessionDefaultsProfiles(
328 config.sessionDefaultsProfiles,
329 options.cwd,
330 );
331 notices.push(...normalizedProfiles.notices);
332 config = { ...config, sessionDefaultsProfiles: normalizedProfiles.profiles };
333 }
334
335 config = resolveRelativeTopLevelPaths(config, options.cwd);
336
337 return { found: true, path: configPath, config, notices };
338 } catch (error) {
339 return { found: false, path: configPath, error: toError(error) };
340 }
341}
342
343export async function persistSessionDefaultsToProjectConfig(
344 options: PersistSessionDefaultsOptions,

Callers 4

initConfigStoreFunction · 0.90
runSetupWizardFunction · 0.90

Calls 13

getConfigPathFunction · 0.85
parseProjectConfigFunction · 0.85
normalizeDebuggerBackendFunction · 0.85
normalizeCustomWorkflowsFunction · 0.85
toErrorFunction · 0.85
existsSyncMethod · 0.80
readFileMethod · 0.80

Tested by

no test coverage detected