Open paganwinter opened 3 years ago
Folders in the options.ignore list are not ignored if they have a trailing forward slash.
options.ignore
/ ├── ignore-first/ | └── file.txt └── ignore-second/ └── file.txt
options.ignore:
['ignore-first/', 'ignore-second']
ignore-first is not ignored in the folders list, while ignore-second is indeed ignored.
ignore-first
ignore-second
dir-glob allows specifying a cwd option as well, which is used by it to determine if an entry in the ignore list is actually a directory or not (https://github.com/kevva/dir-glob/blob/dc6e7978a641fd1e8e4329ba474fb0af65b52519/index.js#L64); this is defaulted to process.cwd(), which doesn't mark such entries as actual directories in the generated glob list.
dir-glob
cwd
This can be fixed by passing the original cwd option to dir-glob below: https://github.com/sindresorhus/globby/blob/7807d29e6f4644d32b2602d835b282954cf0db90/index.js#L105
edit: fixed typos and formatting
Folders in the
options.ignore
list are not ignored if they have a trailing forward slash.options.ignore
:ignore-first
is not ignored in the folders list, whileignore-second
is indeed ignored.dir-glob
allows specifying acwd
option as well, which is used by it to determine if an entry in the ignore list is actually a directory or not (https://github.com/kevva/dir-glob/blob/dc6e7978a641fd1e8e4329ba474fb0af65b52519/index.js#L64); this is defaulted to process.cwd(), which doesn't mark such entries as actual directories in the generated glob list.This can be fixed by passing the original
cwd
option to dir-glob below: https://github.com/sindresorhus/globby/blob/7807d29e6f4644d32b2602d835b282954cf0db90/index.js#L105edit: fixed typos and formatting