Normalize CLI content globs - #5628
Conversation
RobinMalfait
left a comment
There was a problem hiding this comment.
Looks good to me, looks like it fixes 2 issues at once!
| @@ -437,12 +438,14 @@ async function build() { | |||
| } | |||
|
|
|||
| function extractFileGlobs(config) { | |||
There was a problem hiding this comment.
We use this function in both the `getChangedContent.
Lines 461 to 462 in 2ab6e6e
But we also use this function when setting up the chokidar watcher:
Line 702 in 2ab6e6e
And I wonder if this causes issues, because now we are passing normalized paths to chokidar. Do you know if chokidar can handle C:/../ instead of C:\..\? 🤔
Ah nvm, it fixes chokidar as well: https://github.com/paulmillr/chokidar#api
Note: globs must not contain windows separators (), because that's how they work by the standard — you'll need to replace them with forward slashes (/).
Nice!
|
Should we backport this to v2 as well? |
This PR ensures that the
contentglobs are normalized when using the CLI, like they are when not using the CLI.fast-globexpects patterns to always use forward-slashes, but when using something likepath.resolveon Windows your pattern might end up with back-slashes and not working, e.g.This doesn't currently work when using the CLI on Windows, but this PR fixes that.