-
Notifications
You must be signed in to change notification settings - Fork 129
Closed
Description
Environment
- OS Version: macOS 11.2.3
- Node.js Version: 16.0.0
Actual behavior
Calling the sync
method with an array of patterns does not correctly find all of the matching files. Running each pattern separately does.
Note that the files are found correctly when the paths are fully resolved.
Expected behavior
Passing an array of patterns should return the same list of files as running each pattern separately.
Steps to reproduce
- Clone https://github.com/bradlc/fast-glob-bug
npm install
cd test1
node index.js
Code sample
const fg = require('fast-glob')
const assert = require('assert')
let pattern1 = '**/*.js'
let pattern2 = '../test2/**/*.js'
// fails
assert.deepStrictEqual(
fg.sync([pattern1, pattern2]).sort(),
[...fg.sync(pattern1), ...fg.sync(pattern2)].sort()
)