MCPcopy Index your code
hub / github.com/google-gemini/gemini-cli / findFile

Function findFile

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

Source from the content-addressed store, hash-verified

85}
86
87export function findFile(startPath, filter) {
88 if (!fs.existsSync(startPath)) {
89 return null;
90 }
91 const files = fs.readdirSync(startPath);
92 for (const file of files) {
93 const filename = path.join(startPath, file);
94 const stat = fs.lstatSync(filename);
95 if (stat.isDirectory()) {
96 const result = findFile(filename, filter);
97 if (result) return result;
98 } else if (filter(file)) {
99 return filename;
100 }
101 }
102 return null;
103}
104
105export function fileExists(filePath) {
106 return fs.existsSync(filePath);

Callers 1

ensureBinaryFunction · 0.85

Calls 1

filterFunction · 0.50

Tested by

no test coverage detected