mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-19 15:56:48 -07:00
Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
committed by
GitHub
parent
c0d5ab1f1e
commit
8e58df72c6
@@ -19,8 +19,10 @@ export function loadIgnoreRules(
|
||||
const ignoreFiles = service.getAllIgnoreFilePaths();
|
||||
|
||||
for (const filePath of ignoreFiles) {
|
||||
if (fs.existsSync(filePath)) {
|
||||
try {
|
||||
ignorer.add(fs.readFileSync(filePath, 'utf8'));
|
||||
} catch {
|
||||
// Skip files that can't be read (e.g. directories, permission errors)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,7 +105,10 @@ export class IgnoreFileParser implements IgnoreFileFilter {
|
||||
.slice()
|
||||
.reverse()
|
||||
.map((fileName) => path.join(this.projectRoot, fileName))
|
||||
.filter((filePath) => fs.existsSync(filePath));
|
||||
.filter(
|
||||
(filePath) =>
|
||||
fs.statSync(filePath, { throwIfNoEntry: false })?.isFile() ?? false,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user