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

Function readBaseConfigForPersistence

src/utils/project-config.ts:273–292  ·  view source on GitHub ↗
(
  options: PersistenceTargetOptions,
)

Source from the content-addressed store, hash-verified

271}
272
273async function readBaseConfigForPersistence(
274 options: PersistenceTargetOptions,
275): Promise<ProjectConfig> {
276 if (!options.fs.existsSync(options.configPath)) {
277 return { schemaVersion: 1 };
278 }
279
280 try {
281 const rawText = await options.fs.readFile(options.configPath, 'utf8');
282 const parsed = parseProjectConfig(rawText);
283 return { ...normalizeConfigForPersistence(parsed), schemaVersion: 1 };
284 } catch (error) {
285 const errorMessage = error instanceof Error ? error.message : String(error);
286 log(
287 'warn',
288 `Failed to read or parse project config at ${options.configPath}. Overwriting with new config. ${errorMessage}`,
289 );
290 return { schemaVersion: 1 };
291 }
292}
293
294export async function loadProjectConfig(
295 options: LoadProjectConfigOptions,

Calls 5

logFunction · 0.90
parseProjectConfigFunction · 0.85
existsSyncMethod · 0.80
readFileMethod · 0.80

Tested by

no test coverage detected