MCPcopy Create free account
hub / github.com/chakra-ui/panda / walkRemove

Function walkRemove

scripts/rm.mjs:16–34  ·  view source on GitHub ↗
(dir, match, removeNodeModules)

Source from the content-addressed store, hash-verified

14}
15
16const walkRemove = (dir, match, removeNodeModules) => {
17 let entries
18 try {
19 entries = readdirSync(dir, { withFileTypes: true })
20 } catch {
21 return
22 }
23 for (const entry of entries) {
24 const full = join(dir, entry.name)
25 if (match(entry.name)) {
26 rmSync(full, RM)
27 continue
28 }
29 if (entry.isDirectory()) {
30 if (PRUNE.has(entry.name) && !(removeNodeModules && entry.name === 'node_modules')) continue
31 walkRemove(full, match, removeNodeModules)
32 }
33 }
34}
35
36const cwd = process.cwd()
37for (const arg of process.argv.slice(2)) {

Callers 1

rm.mjsFile · 0.85

Calls 2

matchFunction · 0.85
hasMethod · 0.80

Tested by

no test coverage detected