MCPcopy Index your code
hub / github.com/Waishnav/devspace / addDirectory

Function addDirectory

scripts/dev-server.mjs:67–86  ·  view source on GitHub ↗
(dir)

Source from the content-addressed store, hash-verified

65 const seen = new Set();
66
67 function addDirectory(dir) {
68 if (seen.has(dir)) return;
69 seen.add(dir);
70
71 const watcher = watch(dir, (event, filename) => {
72 if (!filename) {
73 scheduleRestart();
74 return;
75 }
76
77 const path = join(dir, filename.toString());
78 if (event === "rename") maybeAddDirectory(path);
79 scheduleRestart();
80 });
81 watchers.push(watcher);
82
83 for (const entry of readdirSync(dir)) {
84 maybeAddDirectory(join(dir, entry));
85 }
86 }
87
88 function maybeAddDirectory(path) {
89 try {

Callers 2

maybeAddDirectoryFunction · 0.85
watchDirectoryFunction · 0.85

Calls 2

scheduleRestartFunction · 0.85
maybeAddDirectoryFunction · 0.85

Tested by

no test coverage detected