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

Function validateFileExists

src/utils/validation.ts:5–18  ·  view source on GitHub ↗
(
  filePath: string,
  fileSystem?: FileSystemExecutor,
)

Source from the content-addressed store, hash-verified

3import type { FileSystemExecutor } from './FileSystemExecutor.ts';
4
5export function validateFileExists(
6 filePath: string,
7 fileSystem?: FileSystemExecutor,
8): ValidationResult {
9 const exists = fileSystem ? fileSystem.existsSync(filePath) : fs.existsSync(filePath);
10 if (!exists) {
11 return {
12 isValid: false,
13 errorMessage: `File not found: '${filePath}'. Please check the path and try again.`,
14 };
15 }
16
17 return { isValid: true };
18}

Calls 1

existsSyncMethod · 0.80

Tested by

no test coverage detected