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

foo/** should not match foo/ #179

Closed
mdjermanovic opened this issue Oct 16, 2022 · 2 comments
Closed

foo/** should not match foo/ #179

mdjermanovic opened this issue Oct 16, 2022 · 2 comments

Comments

@mdjermanovic
Copy link

I would expect that foo/** matches everything inside the directory foo, but not the directory itself.

const minimatch = require("minimatch");

minimatch("foo/", "foo/**"); // true, but it should be false.
@isaacs
Copy link
Owner

isaacs commented Nov 29, 2022

I would expect that foo/** matches everything inside the directory foo, but not the directory itself.

That expectation is incorrect.

$ mkdir -p foo/bar/baz

$ echo foo/**
foo/ foo/bar foo/bar/baz

Working as intended :)

@isaacs isaacs closed this as completed Nov 29, 2022
@isaacs
Copy link
Owner

isaacs commented Nov 29, 2022

You can use foo/*/** to match "everything 1 or more directory levels under foo/" though.

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