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

Fix windows ignore when using anymatch@2 & cwd option #669

Merged
merged 1 commit into from
Jan 18, 2018

Conversation

remy
Copy link
Contributor

@remy remy commented Jan 12, 2018

Fixes #668

Chokidar@2 includes anymatch@2 which has a (potentially) breaking change
as described in the changelog: https://github.com/micromatch/anymatch#change-log

When the cwd is set Chokidar will join the ignore pattern to the cwd,
and if this isn't absolute, it causes anymatch to fail:

// where cwd = c:\Users\remy\
anymatch('C:\\Users\\remy\\**\\node_modules\\**',
'C:\\Users\\remy\\node_modules\\project'); // === false

https://runkit.com/embed/rn05fobk294p

So this change adds the upath module (used by Chokidar during testing
and about 35K footprint) to normalize the path to bash-like slashes
which corrects the issue.

Fixes paulmillr#668

Chokidar@2 includes anymatch@2 which has a (potentially) breaking change
as described in the changelog: https://github.com/micromatch/anymatch#change-log

When the `cwd` is set Chokidar will join the ignore pattern to the cwd,
and if this isn't absolute, it causes `anymatch` to fail:

```js
// where cwd = c:\Users\remy\
anymatch('C:\\Users\\remy\\**\\node_modules\\**',
'C:\\Users\\remy\\node_modules\\project'); // === false
```

https://runkit.com/embed/rn05fobk294p

So this change adds the upath module (used by Chokidar during testing
and about 35K footprint) to normalize the path to bash-like slashes
which corrects the issue.
@es128
Copy link
Collaborator

es128 commented Jan 12, 2018

@remy thank you! This looks good at a glance, I'll take a closer look later.

@coveralls
Copy link

coveralls commented Jan 13, 2018

Coverage Status

Coverage increased (+0.0007%) to 98.478% when pulling 966c300 on remy:master into 3409db8 on paulmillr:master.

@remy
Copy link
Contributor Author

remy commented Jan 18, 2018

Any joy on this PR? I saw the travis builds seem to bail every other build for some reason.

@es128
Copy link
Collaborator

es128 commented Jan 18, 2018

Yeah that's just the flaky filesystems on Travis' OS X VMs. Typically just an annoyance. And Travis was having general issues when I tried to look the other day. The appveyor tests passed, which is the main thing that counts in this case.

@es128 es128 merged commit d26c6e0 into paulmillr:master Jan 18, 2018
@remy
Copy link
Contributor Author

remy commented Jan 18, 2018

Cheers! What's the turnaround for publishing? (just asking so I know when to publish a bump to nodemon too - mine's just automated through travis atm)

@remy
Copy link
Contributor Author

remy commented Feb 1, 2018

Been checking every now and then, and news on when/if this will be pushed to npm? Thanks.

@es128
Copy link
Collaborator

es128 commented Feb 8, 2018

@remy sorry for the delay. Chokidar v2.0.1 with this fix is now published.

@remy
Copy link
Contributor Author

remy commented Feb 8, 2018

🙏 thank you

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

Successfully merging this pull request may close these issues.

None yet

3 participants