From 4f9bd50aced23e48c709b99c7dd51b01ff8a50bf Mon Sep 17 00:00:00 2001 From: Rafael Oleza Date: Tue, 21 May 2019 12:34:42 +0200 Subject: [PATCH] Fix path issues in Windows --- src/ripgrep-directory-searcher.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ripgrep-directory-searcher.js b/src/ripgrep-directory-searcher.js index 58d879e18..230d9b0b1 100644 --- a/src/ripgrep-directory-searcher.js +++ b/src/ripgrep-directory-searcher.js @@ -258,6 +258,10 @@ module.exports = class RipgrepDirectorySearcher { const output = [] for (let pattern of globs) { + // we need to replace path separators by slashes since globs should + // always use always slashes as path separators. + pattern = pattern.replace(new RegExp(`\\${path.sep}`, 'g'), '/') + if (pattern.length === 0) { continue }