There was an error while loading. Please reload this page.
1 parent f5901d7 commit 1024d5cCopy full SHA for 1024d5c
1 file changed
packages/rstack/src/fmt/ignore.ts
@@ -22,9 +22,12 @@ interface CreateIgnoreMatcherOptions {
22
23
const createPatternMatcher = (rootPath: string, patterns: string): IgnoreMatcher => {
24
const matcher = createIgnore({ allowRelativePaths: true }).add(patterns);
25
+ const rootPrefix = rootPath.endsWith(path.sep) ? rootPath : `${rootPath}${path.sep}`;
26
27
return (filePath, isDirectory = false) => {
- const relativePath = path.relative(rootPath, filePath);
28
+ const relativePath = filePath.startsWith(rootPrefix)
29
+ ? filePath.slice(rootPrefix.length)
30
+ : path.relative(rootPath, filePath);
31
if (relativePath === '') {
32
return false;
33
}
0 commit comments