(p: string)
| 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) { |
no test coverage detected