Skip to content

Commit

Permalink
fix: normalize win32 paths before globbing
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Apr 21, 2022
1 parent 601244c commit 16f1343
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/index.js
Expand Up @@ -31,6 +31,7 @@ const packageMustHavesRE = new RegExp(`^(${packageMustHaveFileNames})(\\..*[^~$]

const fs = require('fs')
const glob = require('glob')
const globify = pattern => pattern.split('\\').join('/')

const pathHasPkg = (input) => {
if (!input.startsWith('node_modules/')) {
Expand Down Expand Up @@ -428,7 +429,7 @@ class Walker extends IgnoreWalker {
}

globFiles (pattern, cb) {
glob(pattern, { dot: true, cwd: this.path, nocase: true }, cb)
glob(globify(pattern), { dot: true, cwd: this.path, nocase: true }, cb)
}

readPackageJson (entries) {
Expand Down

0 comments on commit 16f1343

Please sign in to comment.