From e8a6faa53125c5528634ba3d764c281452d450c5 Mon Sep 17 00:00:00 2001 From: Cedric Halbronn Date: Thu, 7 Sep 2023 16:48:08 +0100 Subject: [PATCH] normalize paths from subset file so they work on Windows --- packages/test-harness/src/testSubset.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/test-harness/src/testSubset.ts b/packages/test-harness/src/testSubset.ts index d15a2fcc31..81a079a8d6 100644 --- a/packages/test-harness/src/testSubset.ts +++ b/packages/test-harness/src/testSubset.ts @@ -8,12 +8,17 @@ import { getCursorlessRepoRoot } from "@cursorless/common"; */ export function testSubsetGrepString(): string { const inFile = testSubsetFilePath(); - return fs + let grepStr = fs .readFileSync(inFile, "utf-8") .split(/\r?\n/) .map((line) => line.trim()) .filter((line) => line.length > 0 && !line.startsWith("#")) .join("|"); + if (process.platform === "win32") { + // Path separators are OS specific ("/" for Linux/MacOS and "\\" for Windows). + grepStr = grepStr.replaceAll("/", "\\\\"); + } + return grepStr; } /**