MCPcopy Create free account
hub / github.com/agent-tower/core / listDirectories

Function listDirectories

packages/server/scripts/dev.mjs:28–61  ·  view source on GitHub ↗
(root)

Source from the content-addressed store, hash-verified

26 console.log(`[server:dev] ${message}`);
27}
28
29function listDirectories(root) {
30 if (!existsSync(root)) {
31 return [];
32 }
33
34 const directories = [];
35 const stack = [root];
36
37 while (stack.length > 0) {
38 const dir = stack.pop();
39 directories.push(dir);
40
41 let entries;
42 try {
43 entries = readdirSync(dir, { withFileTypes: true });
44 } catch {
45 continue;
46 }
47
48 for (const entry of entries) {
49 if (!entry.isDirectory()) {
50 continue;
51 }
52
53 if (entry.name === '.git' || entry.name === 'node_modules') {
54 continue;
55 }
56
57 stack.push(path.join(dir, entry.name));
58 }
59 }
60
61 return directories;
62}
63
64function scheduleRescan() {

Callers 1

syncWatchersFunction · 0.85

Calls 2

pushMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected