Skip to content

Commit 91964e4

Browse files
committed
Windows ❤️
1 parent 8b2d402 commit 91964e4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/knip/src/util/glob-core.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { readFileSync } from 'node:fs';
2+
// oxlint-disable-next-line no-restricted-imports
3+
import { basename } from 'node:path';
24
import { fdir } from 'fdir';
35
import { glob as tinyGlob, type GlobOptions as TinyGlobOptions } from 'tinyglobby';
46
import picomatch from 'picomatch';
@@ -176,7 +178,7 @@ export const findAndParseGitignores = async (cwd: string, workspaceDirs?: Set<st
176178
return (isRelevantDir && !isRelevantDir(absPath)) || getMatcher()(absPath.slice(cwdPrefixLen));
177179
})
178180
.filter((filePath: string, isDir: boolean) => {
179-
if (isDir || !filePath.endsWith('/.gitignore')) return false;
181+
if (isDir || basename(filePath) !== '.gitignore') return false;
180182
addFile(filePath);
181183
return true;
182184
})

0 commit comments

Comments
 (0)