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

cwd option does nothing? #105

Open
TwitchBronBron opened this issue Mar 16, 2022 · 2 comments
Open

cwd option does nothing? #105

TwitchBronBron opened this issue Mar 16, 2022 · 2 comments

Comments

@TwitchBronBron
Copy link

TwitchBronBron commented Mar 16, 2022

The cwd option is specified in the docs here.
image

However, It doesn't appear to be used anywhere in the picomatch source code. See this github text search. https://github.com/micromatch/picomatch/search?q=cwd

Here are some simple tests proving the cwd option isn't used.

var picomatch = require('picomatch');

console.log(
    picomatch.isMatch('file.txt', '*.txt')
); //true

console.log(
    picomatch.isMatch('C:/projects/file.txt', '*.txt', { cwd: 'C:/projects' })
); //false

console.log(
    picomatch.isMatch('file.txt', '*.txt', { cwd: 'totally/bogus/cwd' })
); //true

Does picomatch need to be updated to add the cwd option, or should all the unsupported options in the docs be removed?

@3cp
Copy link

3cp commented Apr 30, 2022

Just noticed this issue too.
There is no cwd reference in the code base.

@3cp
Copy link

3cp commented Apr 30, 2022

I think cwd is handled by fast-glob, not the underneath micromatch and picomatch. No idea why the option shows up in micromatch and picomatch's doc.

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