Skip to content

Commit

Permalink
fix: don't try to stat glob patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
jedwards1211 committed Oct 15, 2023
1 parent eecbbae commit 12b1379
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@
projectRoot = process.cwd()
}
ignored = (path, stats) => {
if (!stats) stats = fs.statSync(path)
const result = gitignore.ignoresSync(
stats.isDirectory() ? path + '/' : path
)
let result = false
if (!/(^|[\\/])\*\*?([\\/]|$)/.test(path)) {
if (!stats) stats = fs.statSync(path)
result = gitignore.ignoresSync(stats.isDirectory() ? path + '/' : path)
}
debug('ignored', path, stats, result)
return result
}
Expand Down

0 comments on commit 12b1379

Please sign in to comment.