Skip to content

Commit 4f42923

Browse files
authored
Merge pull request #172 from beeequeue/picomatch
2 parents 20de941 + 74201f5 commit 4f42923

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/match-tasks.js

Lines changed: 3 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,7 @@ 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), { nonegate: true })
4947

5048
return { match, task, args }
5149
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "npm-run-all2",
3+
"type": "commonjs",
34
"version": "8.0.1",
45
"description": "A CLI tool to run multiple npm-scripts in parallel or sequential. (Maintenance fork)",
56
"bin": {
@@ -33,7 +34,7 @@
3334
"ansi-styles": "^6.2.1",
3435
"cross-spawn": "^7.0.6",
3536
"memorystream": "^0.3.1",
36-
"minimatch": "^10.0.1",
37+
"picomatch": "^4.0.2",
3738
"pidtree": "^0.6.0",
3839
"read-package-json-fast": "^4.0.0",
3940
"shell-quote": "^1.7.3",

0 commit comments

Comments
 (0)