-
-
Notifications
You must be signed in to change notification settings - Fork 257
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
Proposal: major release to adopt forward slash, same as node-glob? #109
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
environment: | ||
matrix: | ||
- nodejs_version: "7" | ||
- nodejs_version: "6" | ||
- nodejs_version: "4" | ||
|
||
install: | ||
- ps: Install-Product node $env:nodejs_version | ||
- set CI=true | ||
- npm -g install npm@latest | ||
- set PATH=%APPDATA%\npm;%PATH% | ||
- npm install | ||
|
||
matrix: | ||
fast_finish: true | ||
build: off | ||
version: '{build}' | ||
shallow_clone: true | ||
clone_depth: 1 | ||
|
||
test_script: | ||
- node --version | ||
- npm --version | ||
- cmd: npm test |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's wrong. On Windows '/' character in pattern should match both '/' and '\' characters in file paths. There is not ideal slow implementation (i think this should be done in matching engine) but it work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree. The idea here is to have a cross-platform API, with forward slash as path separator and backward slash as escape. That way you can still match literal forward (on Windows) and backward slashes by escaping them in the pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pattern (as some kind of special language) SHOULD be cross-platform, and therefore need to use one special character (forward slash) as path separator on all platforms.
But, in opposite, file path is platform depended by definition .
For example, code:
if ( minimatch(filepath, 'foo/*.js') ) { /* do something*/
}will perfectly works with current
minimatch
version (or with my fork) on all platforms.But with your commit the condition will do never trigger on Windows.
Moreover, imagine that one day will be invented a new operation system, and it developers decide to use pipe characted ('|') as path separator. The code example will work on this OS without any changes, because filepath
foo|bar.js
will be internally replaced withfoo/bar.js
(using code that you try to remove) and successfully match to the patternfoo/*.js