MCPcopy Create free account
hub / github.com/Waishnav/devspace / walkWorkspace

Function walkWorkspace

src/workspaces.ts:306–328  ·  view source on GitHub ↗
(
  directory: string,
  visit: (path: string, entry: { name: string; isFile(): boolean; isDirectory(): boolean }) => Promise<void> | void,
)

Source from the content-addressed store, hash-verified

304}
305
306async function walkWorkspace(
307 directory: string,
308 visit: (path: string, entry: { name: string; isFile(): boolean; isDirectory(): boolean }) => Promise<void> | void,
309): Promise<void> {
310 let entries;
311 try {
312 entries = await opendir(directory);
313 } catch {
314 return;
315 }
316
317 for await (const entry of entries) {
318 const path = join(directory, entry.name);
319 if (entry.isDirectory()) {
320 if (!SKIPPED_CONTEXT_DIRS.has(entry.name)) {
321 await walkWorkspace(path, visit);
322 }
323 continue;
324 }
325
326 await visit(path, entry);
327 }
328}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected