-
Notifications
You must be signed in to change notification settings - Fork 112
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
ISSUE-240: Method to convert path to pattern #392
Merged
Merged
Conversation
This file contains 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
mrmlnc
force-pushed
the
ISSUE-240_p2p
branch
2 times, most recently
from
May 9, 2023 13:48
d73877a
to
6b0624a
Compare
mrmlnc
force-pushed
the
ISSUE-240_p2p
branch
2 times, most recently
from
May 14, 2023 09:56
1a98e6d
to
688e6a0
Compare
This was referenced Sep 9, 2024
This was referenced Sep 22, 2024
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?
Fix #240.
The main purpose is to allow users to stop processing Windows paths in each location where this package is used, using third-party packages.
The story about automatic pattern conversion is out of the issue now, as it is a separate big layer of problems.
What changes did you make? (Give an overview)
.escapePath
method now escapes a different set of special characters depending on the platform. Two methods have also been added:.escapePosixPath
,.escapeWindowsPath
.1.1. Added support for escaping an escape character (
\\
) when it is not followed by a special character.1.2. On Windows, the following characters
*?|[]
will no longer be escaped. Because it is not possible to use these characters in a path in DOS..convertPathToPattern
method, which allows you to safely convert DOS paths and UNC paths into patterns. Two methods have also been added:.convertPosixPathToPattern
,.convertWindowsPathToPattern
.2.1. This allows Windows paths to be passed as patterns after they have been converted. For example,
fg.convertPathToPattern('\\\\?\\c:\\Program Files (x86)') + '/**'
orfg.convertPathToPattern('C://Program Files (x86)') + '/**'
.2.2. Remove dependencies like
normalize-path
andslash
, which we previously suggested in the documentation.More details in the documentation:
escapePath
andconvertPathToPattern
.