MCPcopy Create free account
hub / github.com/anomalyco/opencode / walk

Function walk

packages/opencode/src/cli/cmd/uninstall.ts:320–334  ·  view source on GitHub ↗
(current: string)

Source from the content-addressed store, hash-verified

318 let total = 0
319
320 const walk = async (current: string) => {
321 const entries = await fs.readdir(current, { withFileTypes: true }).catch(() => [])
322
323 for (const entry of entries) {
324 const full = path.join(current, entry.name)
325 if (entry.isDirectory()) {
326 await walk(full)
327 continue
328 }
329 if (entry.isFile()) {
330 const stat = await fs.stat(full).catch(() => null)
331 if (stat) total += stat.size
332 }
333 }
334 }
335
336 await walk(dir)
337 return total

Callers 1

getDirectorySizeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected