Skip to content

Commit 3c0d2b2

Browse files
beeequeuebcomnes
authored andcommitted
fix new test
1 parent dcf2ac4 commit 3c0d2b2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/match-tasks.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
// Requirements
1111
// ------------------------------------------------------------------------------
1212

13-
const { minimatch } = require('minimatch')
14-
const Minimatch = minimatch.Minimatch
13+
const picomatch = require('picomatch')
1514

1615
// ------------------------------------------------------------------------------
1716
// Helpers
@@ -21,7 +20,7 @@ const COLON_OR_SLASH = /[:/]/g
2120
const CONVERT_MAP = { ':': '/', '/': ':' }
2221

2322
/**
24-
* Swaps ":" and "/", in order to use ":" as the separator in minimatch.
23+
* Swaps ":" and "/", in order to use ":" as the separator in picomatch.
2524
*
2625
* @param {string} s - A text to swap.
2726
* @returns {string} The text which was swapped.
@@ -44,8 +43,10 @@ function createFilter (pattern) {
4443
const spacePos = trimmed.indexOf(' ')
4544
const task = spacePos < 0 ? trimmed : trimmed.slice(0, spacePos)
4645
const args = spacePos < 0 ? '' : trimmed.slice(spacePos)
47-
const matcher = new Minimatch(swapColonAndSlash(task), { nonegate: true })
48-
const match = matcher.match.bind(matcher)
46+
const match = picomatch(swapColonAndSlash(task), {
47+
nonegate: true,
48+
strictSlashes: true,
49+
})
4950

5051
return { match, task, args }
5152
}

0 commit comments

Comments
 (0)