Skip to content

Commit

Permalink
chore(deps): update 'glob' to v8 (#4970)
Browse files Browse the repository at this point in the history
  • Loading branch information
jb2311 committed Mar 30, 2023
1 parent 9f24d0d commit d722d00
Show file tree
Hide file tree
Showing 7 changed files with 6,584 additions and 8,431 deletions.
5 changes: 4 additions & 1 deletion lib/cli/collect-files.js
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
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

0 comments on commit d722d00

Please sign in to comment.