MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / fileExists

Function fileExists

common/src/util/file.ts:256–268  ·  view source on GitHub ↗
(params: {
  filePath: string
  fs: CodebuffFileSystem
})

Source from the content-addressed store, hash-verified

254 * Uses fs.stat instead of Bun-specific fs.exists.
255 */
256export async function fileExists(params: {
257 filePath: string
258 fs: CodebuffFileSystem
259}): Promise<boolean> {
260 const { filePath, fs } = params
261
262 try {
263 await fs.stat(filePath)
264 return true
265 } catch {
266 return false
267 }
268}
269
270export const ensureDirectoryExists = async (params: {
271 baseDir: string

Callers 3

applyChangeFunction · 0.90
parseGitignoreFunction · 0.90
ensureDirectoryExistsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected