Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/cli/collect-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ module.exports = ({
try {
const moreSpecFiles = castArray(lookupFiles(arg, extension, recursive))
.filter(filename =>
ignore.every(pattern => !minimatch(filename, pattern))
ignore.every(
pattern =>
!minimatch(filename, pattern, {windowsPathsNoEscape: true})
)
)
.map(filename => path.resolve(filename));
return [...specFiles, ...moreSpecFiles];
Expand Down
9 changes: 7 additions & 2 deletions lib/cli/lookup-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = function lookupFiles(

if (!fs.existsSync(filepath)) {
let pattern;
if (glob.hasMagic(filepath)) {
if (glob.hasMagic(filepath, {windowsPathsNoEscape: true})) {
// Handle glob as is without extensions
pattern = filepath;
} else {
Expand All @@ -86,7 +86,12 @@ module.exports = function lookupFiles(
pattern = `${filepath}+(${strExtensions})`;
debug('looking for files using glob pattern: %s', pattern);
}
files.push(...glob.sync(pattern, {nodir: true}));
files.push(
...glob.sync(pattern, {
nodir: true,
windowsPathsNoEscape: true
})
);
if (!files.length) {
throw createNoFilesMatchPatternError(
`Cannot find any files matching pattern "${filepath}"`,
Expand Down
Loading