Match dotfiles

This commit is contained in:
Andras Schmelczer 2025-05-24 14:35:25 +01:00
parent 76a17c4221
commit 31833a9f47
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
2 changed files with 4 additions and 1 deletions

View file

@ -6,5 +6,6 @@ describe("globsToRegexes", () => {
const regex = globsToRegexes([".git/**"], new Logger())[0];
expect(regex.test(".git/objects/object")).toBeTruthy();
expect(regex.test(".git/objects/.object")).toBeTruthy();
});
});

View file

@ -4,7 +4,9 @@ import { Logger } from "../tracing/logger";
export function globsToRegexes(globs: string[], logger: Logger): RegExp[] {
return globs
.map((pattern) => {
const result = makeRe(pattern);
const result = makeRe(pattern, {
dot: true
});
if (result === false) {
logger.warn(
`Failed to parse ${pattern}' as a glob pattern, skipping it`