fix: handle drive-relative paths on windows#197
Merged
SuperchupuDev merged 4 commits intoSuperchupuDev:mainfrom Apr 12, 2026
Merged
fix: handle drive-relative paths on windows#197SuperchupuDev merged 4 commits intoSuperchupuDev:mainfrom
SuperchupuDev merged 4 commits intoSuperchupuDev:mainfrom
Conversation
commit: |
Owner
SuperchupuDev
left a comment
There was a problem hiding this comment.
in addition to my comments, also remember to run biome so that ci is green 👍
SuperchupuDev
approved these changes
Apr 12, 2026
Owner
SuperchupuDev
left a comment
There was a problem hiding this comment.
thank you for reporting the issue and sending a fix!!!! 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #196
Just when I thought I learned all Windows quirks, I've found one more...
Turned out, on Windows
L:is not the same thing asL:\. It's called drive-relative path (see https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#apply-the-current-directory) andL:ends up being replace with cwd.In my case I've stumbled upon, I had
L:\test1\repro.jsrunningL:\test\*.pypattern while being inL:\test1as cwd.So naturally,
globhave found a common root to start from -L:, but whenabsoluteis set totrue.The call chain goes like this
globcalls.withPromisetinyglobby/src/index.ts
Line 75 in 5779202
Which constructs a
Walker.https://github.com/thecodrr/fdir/blob/790c182eb54809ea7bc14f1bcb40acce89506bb4/src/api/async.ts#L21
Which calls
normalizePath.https://github.com/thecodrr/fdir/blob/790c182eb54809ea7bc14f1bcb40acce89506bb4/src/api/walker.ts#L40
Which calls
resolveonroot, but only in case ifresolvePathsis set.https://github.com/thecodrr/fdir/blob/790c182eb54809ea7bc14f1bcb40acce89506bb4/src/utils.ts#L33-L39
Which is set, when constructing options for a crawler, from
absoluteoption:tinyglobby/src/crawler.ts
Line 74 in 5779202
Since
L:root comes fromnormalizePatterncall, I've added a check to ensure it appends/in case it's drive-relative path to make it just abs path at drive root and added a test.I've created a workflow to reproduce the issue before and after the fix https://github.com/Andrej730/tinyglobby/actions/runs/24131845264/job/70410134306
@SuperchupuDev can you please take a look?