Skip to content

Commit f9dca2b

Browse files
committed
fix: add windowsPathsNoEscape to preserve behaviour on Windows
1 parent a1955c5 commit f9dca2b

File tree

5 files changed

+30
-102
lines changed

5 files changed

+30
-102
lines changed

.taprc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
timeout: 360
2-
bail: true
32
disable-coverage: true

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class TestExclude {
104104

105105
globSync(cwd = this.cwd) {
106106
const globPatterns = getExtensionPattern(this.extension || []);
107-
const globOptions = { cwd, nodir: true, dot: true };
107+
const globOptions = { cwd, nodir: true, dot: true, posix: true };
108108
/* If we don't have any excludeNegated then we can optimize glob by telling
109109
* it to not iterate into unwanted directory trees (like node_modules). */
110110
if (this.excludeNegated.length === 0) {
@@ -118,7 +118,7 @@ class TestExclude {
118118

119119
async glob(cwd = this.cwd) {
120120
const globPatterns = getExtensionPattern(this.extension || []);
121-
const globOptions = { cwd, nodir: true, dot: true };
121+
const globOptions = { cwd, nodir: true, dot: true, posix: true };
122122
/* If we don't have any excludeNegated then we can optimize glob by telling
123123
* it to not iterate into unwanted directory trees (like node_modules). */
124124
if (this.excludeNegated.length === 0) {

is-outside-dir-win32.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const path = require('path');
44
const { minimatch } = require('minimatch');
55

6-
const dot = { dot: true };
6+
const dot = { dot: true, windowsPathsNoEscape: true };
77

88
module.exports = function(dir, filename) {
99
return !minimatch(path.resolve(dir, filename), path.join(dir, '**'), dot);

package-lock.json

Lines changed: 26 additions & 98 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/glob.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ t.test('allows negated exclude patterns', t =>
8888
})
8989
);
9090

91+
9192
t.test('allows negated include patterns', t =>
9293
testHelper(t, {
9394
options: {

0 commit comments

Comments
 (0)