Skip to content

Commit 59964fe

Browse files
Implicit cwd when parsing file patterns
1 parent 0b51543 commit 59964fe

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/util/parseFilePatterns.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ export async function parseFilePatterns(
99
cli: CLI,
1010
filePatterns: string[],
1111
): Promise<string[]> {
12-
const cwd = process.cwd();
1312
const seen: Set<string> = new Set();
1413
const globFileEndingPattern = getGlobFileEndingsPattern(cli.fileEndings);
1514

@@ -19,7 +18,7 @@ export async function parseFilePatterns(
1918
};
2019

2120
for (const pattern of filePatterns) {
22-
const absolutePath = path.resolve(cwd, pattern);
21+
const absolutePath = path.resolve(pattern);
2322
const stat = await lstatSafe(absolutePath);
2423

2524
if (stat != null) {
@@ -49,7 +48,7 @@ export async function parseFilePatterns(
4948
const glob = normalizeToPosix(pattern);
5049
const files = await fastGlob(glob, globOptions);
5150
for (const file of files) {
52-
seen.add(path.resolve(cwd, file));
51+
seen.add(path.resolve(file));
5352
}
5453
}
5554

0 commit comments

Comments
 (0)