Skip to content

Commit

Permalink
add check for negative ignore patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
zaverden committed Jan 12, 2020
1 parent 9a2930f commit aa302b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ function setupIgnores (self, options) {

// ignore patterns are always in dot:true mode.
function ignoreMap (pattern) {
var matcher = new Minimatch(pattern, { dot: true })
var gmatcher = null
if (pattern.slice(-3) === '/**') {
// negative patters does not require for additional check
if (!matcher.negate && pattern.slice(-3) === '/**') {
var gpattern = pattern.replace(/(\/\*\*)+$/, '')
gmatcher = new Minimatch(gpattern, { dot: true })
}

return {
matcher: new Minimatch(pattern, { dot: true }),
matcher: matcher,
gmatcher: gmatcher
}
}
Expand Down

0 comments on commit aa302b5

Please sign in to comment.