MCPcopy Create free account
hub / github.com/arctic-cli/interface / walk

Function walk

packages/arctic/src/cli/cmd/uninstall.ts:327–341  ·  view source on GitHub ↗
(current: string)

Source from the content-addressed store, hash-verified

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

Callers 1

getDirectorySizeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected