From 2934b30d78fe656a8262f20c7042b68fb40bda7c Mon Sep 17 00:00:00 2001 From: Tomas Brixi Date: Tue, 23 Nov 2021 09:31:18 +0100 Subject: [PATCH] [#110] - support fast-glob for windows --- src/index.ts | 4 +++- src/util.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 6363f58..880e289 100644 --- a/src/index.ts +++ b/src/index.ts @@ -29,7 +29,9 @@ interface CliOptions { async function findBrsFiles(sourceDir?: string) { let searchDir = sourceDir || "source"; - const pattern = path.join(process.cwd(), searchDir, "**", "*.brs"); + const pattern = path + .join(process.cwd(), searchDir, "**", "*.brs") + .replace(/\\/g, "/"); return fastGlob(pattern); } diff --git a/src/util.ts b/src/util.ts index 4663d94..8f1cd01 100644 --- a/src/util.ts +++ b/src/util.ts @@ -47,7 +47,7 @@ export async function globMatchFiles(filePatterns: string[]) { } else { testsPattern += `{${parsedPatterns.join(",")}}`; } - + testsPattern = testsPattern.replace(/\\/g, "/"); // exclude node_modules from the test search return fastGlob([testsPattern, `!${process.cwd()}/node_modules/**/*`]); }