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

can't support pattern /src/*/index.* #266

Closed
tianyingchun opened this issue Apr 15, 2020 · 3 comments · Fixed by #275
Closed

can't support pattern /src/*/index.* #266

tianyingchun opened this issue Apr 15, 2020 · 3 comments · Fixed by #275
Assignees
Milestone

Comments

@tianyingchun
Copy link

Environment

  • OS Version: mac os 10.14.5
  • Node.js Version: v13.12.0

Actual behavior

input `/src/*/index.*` ==>  "src/*/index.*"

Expected behavior

input /src/*/index.* ==> ["src/A/index.ts", "src/B/index.ts"]

Steps to reproduce

Code sample

// Paste your code here.
@papb
Copy link

papb commented Apr 26, 2020

Shouldn't you be using /src/**/index.* instead?

@mrmlnc mrmlnc self-assigned this Apr 27, 2020
@mrmlnc
Copy link
Owner

mrmlnc commented Apr 28, 2020

Looks like a bug, because the deep filter ignore nested directories for patterns that starts with /. Most likely this is related to the partial matcher.

As workaround you can use cwd option:

const fg = require('fast-glob');

const entries = fg.sync('lib/*/libpt*', {
	cwd: '/'
});

console.dir(entries, { colors: true });

@mrmlnc
Copy link
Owner

mrmlnc commented Jun 16, 2020

Shipped with 3.2.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants