( filePath: string, fileSystem?: FileSystemExecutor, )
| 3 | import type { FileSystemExecutor } from './FileSystemExecutor.ts'; |
| 4 | |
| 5 | export 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 | } |
no test coverage detected