sindresorhus / globby

User-friendly glob matching
MIT License
2.49k stars 126 forks source link

Multimatch ignore file not supported #257

Open fletort opened 9 months ago

fletort commented 9 months ago

I use a ignore file that is evaluated by multimatch (https://github.com/google/clasp#ignore-file-claspignore)

So with a such exemple:

**/**
!src/**
!ut/**
!appsscript.json

should select all file in src and ut directory and appsscript.sjon file.

This is not the case with globby. With this code:

const paths = await globby(['**/**'], {ignoreFiles: '.claspignore'});
console.log(paths);

The result is:

> node .\script.mjs
[ 'appsscript.json' ]

The file from src and ut directories are not "selected".

What i am missing ?

arsnl commented 7 months ago

The documentation mention that the value of the ignoreFiles must be Glob patterns to look for ignore files, which are then used to ignore globbed files..

In you case, something like that should work.


- const paths = await globby(['**/**'], {ignoreFiles: '.claspignore'});
+ const paths = await globby(['**/**'], {ignoreFiles: '**/.claspignore'});
console.log(paths);