fast-glob: Ignore patterns don't work in `ignore` option

Environment

  • OS Version: ubuntu 17.10
  • Node.js Version: latest

Actual behavior

Ignore patterns don’t work in ignore option.

Expected behavior

Ignore patterns should be work in ignore option. node-glob works perfect.

Steps to reproduce

  1. Create file.txt with any contents.
  2. Create file.yaml with any contents.

Code sample

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

fg(['**/*'], {
  absolute: true,
  dot: true,
  ignore: [`!{**/*,*}.txt`],
  onlyFiles: true
})
  .then((entries) => console.log(entries));

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 1
  • Comments: 16 (7 by maintainers)

Most upvoted comments

Another issue about this functionality — #356.

Unfortunately, I could not come up with a decent algorithm that allowed me to implement this functionality without completely rewriting the pattern-matching mechanism when reading in depth.

I will try again later, after the major release of this package. Most likely, it’s time to reconsider the approach to how we process patterns in the pattern manager and their further application to directories.

I cannot promise any specific dates.

@mrmlnc, I too have a situation where we want to use negative ignore patterns to allow certain files to be included in the output, which would otherwise, be excluded due to other ignore patterns. Would be great to see some progress on this!