Closed naturalethic closed 6 years ago
This is correct, you escaped the first brace, \\[
so the second one is a parsing error. Backticks are used for escaping in glob patterns. All path separators must be forward slashes. This isn't our rule, it's the rule for all globbing libraries.
Those aren't escaped brackets, they're escaped backslashes for a windows path. Keep in mind that p2
resolves internally to the string 'C:\Users\foo\Workspace\project\routes\[locale]'
, with no escapes. Those are literal backslashes, not escape sequences.
This isn't our rule, it's the rule for all globbing libraries.
If that is true, perhaps this bug belongs to chokidar, we'll see what they say on their ticket.
To be clear, chokidar is broken on Windows due to this libraries inability to recognize this condition.
To be clear, \\[foo]
is an invalid bracket expression. This topic has been exhaustively discussed on many issues on several projects. If chokidar is creating the glob pattern, then that is a bug in chokidar, since glob patterns should only use backslashes for escaping a value. Given that \\
in a string is converted to \
in a regex, it is actually escaping [
, not the backslash. I would be happy to discuss and help with creating a solution on chokidar. But it is not a bug in this library.
If that is true, perhaps this bug belongs to chokidar, we'll see what they say on their ticket.
I'd be happy to help there.
Yep, ok sorry, i had deleted that line in my comment, I'm not fully awake yet.
Yep, ok sorry, i had deleted that line in my comment, I'm not fully awake yet.
no that's ok, I didn't mean to sound harsh. it happens
Definitely looks like this is a chokidar bug: https://github.com/paulmillr/chokidar/issues/699#issuecomment-437293197