-
Notifications
You must be signed in to change notification settings - Fork 26
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
Absolute paths provided as the source are changed and error out #35
Comments
oh this was ignored for months now 🙃 https://github.com/terkelg/tiny-glob/blob/master/index.js#L13 it's this line > path.join('.', '/wew')
'wew' |
Thanks for the bump & investigation @ForsakenHarmony 👏 |
I mentioned it up in the first post of the issue, but I think the funkiness is coming from having an actual dot |
Ah, sorry. I dont think I ever looked at this issue.
|
Hello!
Big fan of the speed gains here, but hit a snag when I was migrating a project away from
fast-glob
. Due to howtiny-glob
defaults to.
as thecwd
if you don't pass anything in, it causes thepath.join
call withinwalk
to accidentally break the absolute path that was provided as thesrc
.In other words, when I pass in something like:
It gets turned into this by that
join
due to that.
being prepended to the file path:Which then throws an error, because that path does not exist.
Not sure how major of a change it'd be, but it may be worth considering hitting a provided source with
path.isAbsolute
and skip thecwd
prepend if it returnstrue
?I didn't check
node-glob
, but it does appear to be howfast-glob
approaches this situation.(Somewhat related, but
fast-glob
also usesprocess.cwd()
instead of defaulting to the string dot.
forcwd
, which may also be a bit more resilient to any other weird interpretations of that pathing.)Happy to take a swing at this as well if you're interested. Thank you!
The text was updated successfully, but these errors were encountered: