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

Function isAxeAtLeastVersion

src/utils/axe-helpers.ts:195–216  ·  view source on GitHub ↗
(
  required: string,
  executor?: CommandExecutor,
)

Source from the content-addressed store, hash-verified

193 * If AXe is missing or the version cannot be parsed, returns false.
194 */
195export async function isAxeAtLeastVersion(
196 required: string,
197 executor?: CommandExecutor,
198): Promise<boolean> {
199 const axePath = getAxePath();
200 if (!axePath) return false;
201
202 const exec = executor ?? getDefaultCommandExecutor();
203 try {
204 const res = await exec([axePath, '--version'], 'AXe Version', true);
205 if (!res.success) return false;
206
207 const output = res.output ?? '';
208 const versionMatch = output.match(/(\d+\.\d+\.\d+)/);
209 if (!versionMatch) return false;
210
211 const current = versionMatch[1];
212 return compareSemver(current, required) >= 0;
213 } catch {
214 return false;
215 }
216}

Callers

nothing calls this directly

Calls 4

getAxePathFunction · 0.85
execFunction · 0.85
compareSemverFunction · 0.85

Tested by

no test coverage detected