You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fix from #53 causes paths prefixed with / to not mount the path on top of the passed in root path.
When I pass in { root: 'c:\foo' } or something like that, and try to match /bar i will end up with c:\bar instead of what I expect, which is c:\foo\bar. Or at least I've understood that's how it works from reading the documentation.
root The place where patterns starting with / will be mounted onto. Defaults to path.resolve(options.cwd, "/") (/ on Unix systems, and C:\ or some such on Windows.)
path.resolve('/foo/bar', './baz')
// returns
'/foo/bar/baz'
path.resolve('/foo/bar', '/tmp/file/')
// returns
'/tmp/file'
path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif')
// if currently in /home/myself/node, it returns
'/home/myself/node/wwwroot/static_files/gif/image.gif'
Passing in a leading / to any argument of path.resolve() seems to mount it at root. My suggestion is to not try and do too much to Windows absolute paths in prefix.
The fix from #53 causes paths prefixed with
/
to not mount the path on top of the passed in root path.When I pass in
{ root: 'c:\foo' }
or something like that, and try to match/bar
i will end up withc:\bar
instead of what I expect, which isc:\foo\bar
. Or at least I've understood that's how it works from reading the documentation.root
The place where patterns starting with/
will be mounted onto. Defaults topath.resolve(options.cwd, "/")
(/
on Unix systems, andC:\
or some such on Windows.)Passing in a leading
/
to any argument ofpath.resolve()
seems to mount it at root. My suggestion is to not try and do too much to Windows absolute paths inprefix
.It all works for me when I uncomment these lines, but I understand it breaks the previous issue: https://github.com/isaacs/node-glob/blob/master/glob.js#L369-L370
The text was updated successfully, but these errors were encountered: