Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some files are not found when using pattern array #310

Closed
bradlc opened this issue Apr 30, 2021 · 1 comment
Closed

Some files are not found when using pattern array #310

bradlc opened this issue Apr 30, 2021 · 1 comment
Milestone

Comments

@bradlc
Copy link

bradlc commented Apr 30, 2021

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

  1. Clone https://github.com/bradlc/fast-glob-bug
  2. npm install
  3. cd test1
  4. 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()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants