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

Support passing glob options like nocase #65

Closed
1 of 2 tasks
orellabac opened this issue May 26, 2021 · 2 comments
Closed
1 of 2 tasks

Support passing glob options like nocase #65

orellabac opened this issue May 26, 2021 · 2 comments

Comments

@orellabac
Copy link

Before you open this issue, please complete the following tasks:

  • [ x] use the search bar at the top of the page to search this repository for similar issues or discussions that have already been opened.
  • [ x] if you are looking for help from the gulp team or community, open a discussion.
  • if you think there is a problem with the plugin you're using, open a discussion.
  • if you think there is a bug in our code, open this issue.

Our thoughts on feature requests

Lots of developers rely on gulp, so we don't make big changes very often. Not every feature request will be added to gulp, but hearing about what you want is important. Don't be afraid to submit a feature request!

Describe your idea for a new feature

the glob watcher relies on anymatch which supports a lot of options. For example for me nocase is an example of option I wound like.

Explain the problem your idea is trying to solve

I need to use glob-matcher to match some globs with case insensitivy

How will it benefit gulp and its users?

I think it just allows a whole new set of options without bracking the current functionality

If this feature could exist outside of gulp (like as a plugin or a module), would you be interested in helping to create and maintain it?

@phated
Copy link
Member

phated commented May 26, 2021

All options are passed through here: https://github.com/gulpjs/glob-watcher/blob/master/index.js#L105

@phated phated closed this as completed May 26, 2021
@orellabac
Copy link
Author

Thanks let me give a try.
I was under the impression from my review of the code that:

  // TODO: I'm not sure how to test this  
if (negatives.some(exists)) {    
var normalizedPositives = positives.map(joinCwd);    
var normalizedNegatives = negatives.map(joinCwd);   
 var shouldBeIgnored = function(path) {      
var positiveMatch = anymatch(normalizedPositives, path, true);      
var negativeMatch = anymatch(normalizedNegatives, path, true);      
//if negativeMatch is -1, that means it was never negated      
if (negativeMatch === -1) {        return false;      }
      // If the negative is "less than" the positive, that means      // it came later in the glob array before we reversed them      return negativeMatch < positiveMatch;    };
    opt.ignored = [].concat(opt.ignored, shouldBeIgnored);  }

The anymatch calls above where not taking advantage of the given options.

I will just test again. Thanks !

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

No branches or pull requests

2 participants