MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / walk

Function walk

source code/utils/plugins/pluginDirectories.ts:137–153  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

135 const dir = pluginDataDirPath(pluginId)
136 let bytes = 0
137 const walk = async (p: string) => {
138 for (const entry of await readdir(p, { withFileTypes: true })) {
139 const full = join(p, entry.name)
140 if (entry.isDirectory()) {
141 await walk(full)
142 } else {
143 // Per-entry catch: a broken symlink makes stat() throw ENOENT.
144 // Without this, one broken link bubbles to the outer catch →
145 // returns null → dialog skipped → data silently deleted.
146 try {
147 bytes += (await stat(full)).size
148 } catch {
149 // Broken symlink / raced delete — skip this entry, keep walking
150 }
151 }
152 }
153 }
154 try {
155 await walk(dir)
156 } catch (e) {

Callers 1

getPluginDataDirSizeFunction · 0.70

Calls 2

readdirFunction · 0.85
statFunction · 0.85

Tested by

no test coverage detected