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

Function getAxeVersionMetadata

src/utils/sentry.ts:288–306  ·  view source on GitHub ↗
(
  runCommand: (command: string[]) => Promise<{ success: boolean; output: string }>,
  axePath: string | undefined,
)

Source from the content-addressed store, hash-verified

286}
287
288export async function getAxeVersionMetadata(
289 runCommand: (command: string[]) => Promise<{ success: boolean; output: string }>,
290 axePath: string | undefined,
291): Promise<string | undefined> {
292 if (!axePath) {
293 return undefined;
294 }
295
296 try {
297 const result = await runCommand([axePath, '--version']);
298 if (!result.success) {
299 return undefined;
300 }
301 const versionLine = result.output.trim().split('\n')[0]?.trim();
302 return versionLine || undefined;
303 } catch {
304 return undefined;
305 }
306}
307
308export function initSentry(context?: Pick<SentryRuntimeContext, 'mode'>): void {
309 if (initialized || isSentryDisabled() || isTestEnv()) {

Callers 1

enrichSentryMetadataFunction · 0.90

Calls 1

runCommandFunction · 0.85

Tested by

no test coverage detected