MCPcopy Index your code
hub / github.com/codeaashu/claude-code / walk

Function walk

src/utils/plugins/pluginDirectories.ts:135–151  ·  view source on GitHub ↗
(p: string)

Source from the content-addressed store, hash-verified

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

Callers 1

getPluginDataDirSizeFunction · 0.70

Calls 2

readdirFunction · 0.85
statFunction · 0.85

Tested by

no test coverage detected