mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-24 03:54:43 -07:00
fix(core): handle line endings in ignore file parsing (#23895)
Co-authored-by: cynthialong0-0 <82900738+cynthialong0-0@users.noreply.github.com>
This commit is contained in:
@@ -52,7 +52,7 @@ export class GitIgnoreParser implements GitIgnoreFilter {
|
||||
.split(path.sep)
|
||||
.join(path.posix.sep);
|
||||
|
||||
const rawPatterns = content.split('\n');
|
||||
const rawPatterns = content.split(/\r\n|\n|\r/);
|
||||
return ignore().add(this.processPatterns(rawPatterns, relativeBaseDir));
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ export class IgnoreFileParser implements IgnoreFileFilter {
|
||||
debugLogger.debug(`Loading ignore patterns from: ${patternsFilePath}`);
|
||||
|
||||
return (content ?? '')
|
||||
.split('\n')
|
||||
.split(/\r\n|\n|\r/)
|
||||
.map((p) => p.trim())
|
||||
.filter((p) => p !== '' && !p.startsWith('#'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user