From 0295642fba0195a7587d10544da9a29703dcbafb Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Tue, 3 Jan 2023 18:23:00 -0800 Subject: [PATCH 1/2] explicitly name filelist.js in jakefile to ensure tests are run, despite glob problem. --- jakefile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jakefile.js b/jakefile.js index 18d4d7d..4f3a331 100644 --- a/jakefile.js +++ b/jakefile.js @@ -1,5 +1,5 @@ testTask('FileList', function () { - this.testFiles.include('test/*.js'); + this.testFiles.include('test/filelist.js'); }); publishTask('FileList', function () { From 35fc9f82d8c4edd1a468744312e4e6f6e381a887 Mon Sep 17 00:00:00 2001 From: Marcus10110 Date: Tue, 3 Jan 2023 18:25:08 -0800 Subject: [PATCH 2/2] fixes #15 The pattern is normalized right before being passed to minimatch, which uses glob to check for directory matches. This converts Unix path separators back to Windows separators, so the regex replace is needed to convert them back to unix separators, as required by minimatch. --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 34ca389..ba848aa 100644 --- a/index.js +++ b/index.js @@ -198,6 +198,7 @@ globSync = function (pat, opts) { if (files) { pat = path.normalize(pat); + pat = pat.replace(/\\/g, '/') matches = minimatch.match(files, pat, opts || {}); } return matches || [];