Skip to content

Commit af70339

Browse files
committed
windows test fix
1 parent 154e8a4 commit af70339

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/all-combinations.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { execSync } from "node:child_process";
44
import { mkdirSync, existsSync, rmSync } from "node:fs";
55
import path from "node:path";
6+
import process from "node:process";
67
import { fileURLToPath } from "node:url";
78

89
const __filename = fileURLToPath(import.meta.url);
@@ -97,7 +98,12 @@ for (let i = 0; i < allCombinations.length; i++) {
9798
// Run prettier on generated files to fix formatting issues (including escaped quotes)
9899
console.log(`Running prettier on ${outputDir}`);
99100
try {
100-
execSync(`npx prettier --write "${outputDir}/**/*.{js,jsx,ts,tsx}"`, {
101+
// Use cross-platform path handling for prettier
102+
const prettierCommand = process.platform === 'win32'
103+
? `npx prettier --write "${outputDir.replace(/\\/g, '/')}/**/*.{js,jsx,ts,tsx}"`
104+
: `npx prettier --write "${outputDir}/**/*.{js,jsx,ts,tsx}"`;
105+
106+
execSync(prettierCommand, {
101107
stdio: "inherit",
102108
});
103109
} catch (prettierError: unknown) {

0 commit comments

Comments
 (0)