From 5ff11ebe4230110f3e95cd42ea70da8ef5450422 Mon Sep 17 00:00:00 2001 From: Erik Kemperman Date: Mon, 8 May 2017 15:53:12 +0200 Subject: [PATCH 1/2] Enable Appveyor CI --- appveyor.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..c7dbf178 --- /dev/null +++ b/appveyor.yml @@ -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 From 4d955cae573d1a092290586f8d2df00df76a0365 Mon Sep 17 00:00:00 2001 From: Erik Kemperman Date: Mon, 8 May 2017 15:53:16 +0200 Subject: [PATCH 2/2] Expect exclusively forward slash as path sep, same as node-glob --- README.md | 9 +++++++++ minimatch.js | 15 --------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index ad72b813..a6d4bedb 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,15 @@ See: * `man 3 fnmatch` * `man 5 gitignore` +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + ## Minimatch Class Create a minimatch object by instantiating the `minimatch.Minimatch` class. diff --git a/minimatch.js b/minimatch.js index 5b5f8cf4..c4d99439 100644 --- a/minimatch.js +++ b/minimatch.js @@ -1,11 +1,6 @@ module.exports = minimatch minimatch.Minimatch = Minimatch -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = require('brace-expansion') @@ -119,11 +114,6 @@ function Minimatch (pattern, options) { if (!options) options = {} pattern = pattern.trim() - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - this.options = options this.set = [] this.pattern = pattern @@ -708,11 +698,6 @@ function match (f, partial) { var options = this.options - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - // treat the test path as a set of pathparts. f = f.split(slashSplit) this.debug(this.pattern, 'split', f)