MCPcopy Create free account
hub / github.com/cursorless-dev/cursorless / walkFiles

Function walkFiles

src/testUtil/walkAsync.ts:12–23  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

10 * @returns
11 */
12export const walkFiles = async (dir: string): Promise<string[]> => {
13 const dirEntries = await readdir(dir, { withFileTypes: true });
14
15 return flatten(
16 await Promise.all(
17 dirEntries.map(async (dirent) => {
18 const filePath = path.join(dir, dirent.name);
19 return dirent.isDirectory() ? await walkFiles(filePath) : [filePath];
20 })
21 )
22 );
23};

Callers 2

initMethod · 0.90
updateUserSnippetsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected