MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / pruneOldBundles

Function pruneOldBundles

scripts/npm-shim.js:253–264  ·  view source on GitHub ↗
(bundlesDir, keepDir)

Source from the content-addressed store, hash-verified

251// are touched; other platforms' bundles and the ".dl-*" staging dirs are left
252// alone.
253function pruneOldBundles(bundlesDir, keepDir) {
254 var keep = path.basename(keepDir);
255 try {
256 var names = fs.readdirSync(bundlesDir);
257 for (var i = 0; i < names.length; i++) {
258 var name = names[i];
259 if (name === keep) continue;
260 if (name.indexOf(target + '-') !== 0) continue;
261 rmrf(path.join(bundlesDir, name));
262 }
263 } catch (e) { /* best effort — never break a working run over cleanup */ }
264}
265
266function fail(reason) {
267 process.stderr.write(

Callers 1

selfHealBundleFunction · 0.85

Calls 2

rmrfFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected