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

Function ensureDirectoryExists

common/src/util/file.ts:270–280  ·  view source on GitHub ↗
(params: {
  baseDir: string
  fs: CodebuffFileSystem
})

Source from the content-addressed store, hash-verified

268}
269
270export const ensureDirectoryExists = async (params: {
271 baseDir: string
272 fs: CodebuffFileSystem
273}) => {
274 const { baseDir, fs } = params
275
276 const baseDirExists = await fileExists({ filePath: baseDir, fs })
277 if (!baseDirExists) {
278 await fs.mkdir(baseDir, { recursive: true })
279 }
280}
281
282/**
283 * Removes markdown code block syntax if present, including any language tag

Callers

nothing calls this directly

Calls 1

fileExistsFunction · 0.85

Tested by

no test coverage detected