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

trailing slashes on directories return no results #290

Closed
rijnhard opened this issue Sep 22, 2020 · 3 comments
Closed

trailing slashes on directories return no results #290

rijnhard opened this issue Sep 22, 2020 · 3 comments
Assignees
Milestone

Comments

@rijnhard
Copy link
Contributor

rijnhard commented Sep 22, 2020

Environment

  • OS Version: Linux Mint 20 5.4.0-47-generic
  • Node.js Version: 12.18.4

Actual behavior

With settings

{
  onlyFiles      : false,
  onlyDirectories: true,
  markDirectories: true,
  absolute     : true,
  globstar      : false
}

Pattern test/fixtures/*/ returns no results.
But Pattern test/fixtures/* does return results.

Expected behavior

Directory Patterns test/fixtures/*/ and test/fixtures/*/ should be equivalent.

Code sample

import fglob from 'fast-glob';

const dirGlobSettings =  {
  onlyFiles      : false,
  onlyDirectories: true,
  markDirectories: true,
  absolute     : true,
  globstar      : false
};

const relativeDirGlob1 = 'test/fixtures/*/';
const relativeDirGlob2 = 'test/fixtures/*';

fglob.sync(relativeDirGlob1, dirGlobSettings);
fglob.sync(relativeDirGlob2, dirGlobSettings);

Side note: should the output should respect markDirectories?

@Trott
Copy link
Contributor

Trott commented Dec 12, 2021

I ran git bisect to find where this bug was introduced and it's in 5ddccbc. That's a really small change set that was a refactor. No bug fix or new feature. So I suspect reverting it will fix this bug.

@Trott
Copy link
Contributor

Trott commented Dec 12, 2021

Proposed fix (or at least a fix for most cases) in #335.

@mrmlnc
Copy link
Owner

mrmlnc commented Jan 1, 2022

Fixed in the master branch by #339. The release with 3.2.8 version will be released soon.

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

3 participants