MCPcopy Create free account
hub / github.com/ConardLi/easy-llm-cli / findFile

Function findFile

scripts/telemetry_utils.js:75–91  ·  view source on GitHub ↗
(startPath, filter)

Source from the content-addressed store, hash-verified

73}
74
75export function findFile(startPath, filter) {
76 if (!fs.existsSync(startPath)) {
77 return null;
78 }
79 const files = fs.readdirSync(startPath);
80 for (const file of files) {
81 const filename = path.join(startPath, file);
82 const stat = fs.lstatSync(filename);
83 if (stat.isDirectory()) {
84 const result = findFile(filename, filter);
85 if (result) return result;
86 } else if (filter(file)) {
87 return filename;
88 }
89 }
90 return null;
91}
92
93export function fileExists(filePath) {
94 return fs.existsSync(filePath);

Callers 1

ensureBinaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected