Skip to content

Commit b3bba07

Browse files
committed
Add path.sep check
1 parent ea7ceb0 commit b3bba07

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/cli/util.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@ function createIgnorerFromContextOrDie(context) {
400400
function eachFilename(context, patterns, callback) {
401401
// workaround for fast-glob on Windows ref:
402402
// https://github.com/mrmlnc/fast-glob#how-to-write-patterns-on-windows
403-
patterns = patterns.map(path => path.replace(/\\/g, "/"));
403+
if (path.sep === "\\") {
404+
patterns = patterns.map(path => path.replace(/\\/g, "/"));
405+
}
404406

405407
// The '!./' globs are due to https://github.com/prettier/prettier/issues/2110
406408
const ignoreNodeModules = context.argv["with-node-modules"] !== true;

0 commit comments

Comments
 (0)