Repository navigation
fix: read the root of a drive for patterns like C:/* on Windows - #527
Open
SulimanAbdulrazzaq wants to merge 1 commit into
Open
SulimanAbdulrazzaq wants to merge 1 commit into
SulimanAbdulrazzaq wants to merge 1 commit into
Conversation
glob-parent returns `C:` as the base directory of `C:/*`. Windows resolves a drive letter without a separator to the current directory on that drive, so the pattern listed the current working directory and reported its entries as if they were in the drive root. Keep the trailing separator for such bases, the same way `/*` gets `/`. Fixes mrmlnc#375
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
Author
|
@mrmlnc when you have a moment, could you approve the workflow runs on this one? It fixes #375: on Windows, a pattern for the root of a drive such as |
Author
|
@mrmlnc when you have a moment, could one of you approve the workflow runs and take a look at this one? No checks have run on the current head yet. |
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.
What is the purpose of this pull request?
Fixes #375. On Windows, a pattern for the root of a drive, such as
C:/*, lists the current working directory instead of the drive root.glob-parentreturnsC:as the base directory ofC:/*(gulpjs/glob-parent#63). Windows resolves a drive letter without a separator to the current directory on that drive, sopath.resolve(cwd, 'C:')is the cwd. The entries found there are then reported under the drive, for exampleC:/srcfor the repository's ownsrcdirectory.C:/./*already works because its base isC:/..What changes did you make? (Give an overview)
groupPatternsByBaseDirectorynow keeps the trailing slash when the base is a bare drive letter taken from aX:/…pattern, so the base ofC:/*isC:/, the same way/*gets/. This only applies on Windows. On other platformsC:is an ordinary relative directory name, so nothing changes there.utils/pathnext toappendTrailingSeparatorToDeviceRoot, and it runs aftergetBaseDirectoryrather than inside it.managers/tasks.spec.ts.globSynctest that uses a customfs.readdirSyncto check that the drive root is the directory being read.