MCPcopy
hub / github.com/rpamis/comet / readDir

Function readDir

src/utils/file-system.ts:88–99  ·  view source on GitHub ↗
(dirPath: string)

Source from the content-addressed store, hash-verified

86 * List entries in a directory. Returns empty array if directory doesn't exist.
87 */
88export async function readDir(dirPath: string): Promise<string[]> {
89 try {
90 return await fs.readdir(dirPath);
91 } catch (error) {
92 const code = (error as NodeJS.ErrnoException)?.code;
93 if (code === 'ENOENT' || code === 'ENOTDIR') {
94 return [];
95 }
96
97 throw error;
98 }
99}
100
101/**
102 * Returns true when an error means the path was simply not found. ENOENT is

Callers 11

checkScriptsPresentFunction · 0.85
checkCometYamlValidityFunction · 0.85
getActiveChangesFunction · 0.85
hasLocalCometSkillsFunction · 0.85
hasOpenCodeCometCommandsFunction · 0.85
hasSkillsFunction · 0.85
removeKiroHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected