gulpjs / glob-stream

Readable streamx interface over anymatch.
MIT License
178 stars 53 forks source link

addresses absolute-glob issue 53 #55

Closed jonschlinkert closed 8 years ago

jonschlinkert commented 8 years ago

This pr fixes the issue mentioned in #53. The code in the solution is based on code that is currently in glob-stream, and the solution was motivated by @natewallace and the problem he brought to light in #53.

fwiw I was tempted to also add checking for absolute paths, but since this fix works for every use case that is currently in the unit tests in glob-stream, as well as the test cases I could come up with for is-absolute-glob, IMHO it would be a better idea to use real feedback to drive any additional logic.

last, if for some reason there is an unforeseen circumstance where the glob is already absolute and a cwd and/or root is passed on the options, then this solution might fail if path.join is used to combine the cwd/root and the glob. e.g. we'll end up with a duplicated absolute path. But... it seems like that would be the expected result, given that a cwd was passed. Anyway, just wanted to point this out so that if it happens we know what's happening and can fix it quickly..

(btw the dependencies in package.json were re-ordered automatically by npm, sorry about the extra cruft)

jonschlinkert commented 8 years ago

thanks!