Skip to content

Commit

Permalink
fix: ensure tsc-all.mjs can run on Windows (#5302)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbbot authored Mar 21, 2024
1 parent bdc121d commit 4e0f6f4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions fixtures/vitest-pool-workers-examples/tsc-all.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import assert from "node:assert";
import childProcess from "node:child_process";
import fs from "node:fs/promises";
import path from "node:path";
Expand All @@ -15,12 +16,17 @@ async function* walkTsConfigs(rootPath) {
}
}

assert(
process.env.PATH?.includes(path.join(__dirname, "node_modules/.bin")),
"Expected `tsc-all.mjs` to be run with `pnpm check:type`"
);

for await (const tsconfigPath of walkTsConfigs(__dirname)) {
console.log(`Checking ${path.relative(__dirname, tsconfigPath)}...`);
const result = childProcess.spawnSync(
"node_modules/.bin/tsc",
["-p", tsconfigPath],
{ stdio: "inherit", cwd: __dirname, shell: true }
);
const result = childProcess.spawnSync("tsc", ["-p", tsconfigPath], {
stdio: "inherit",
cwd: __dirname,
shell: true,
});
if (result.status !== 0) process.exitCode = 1;
}

0 comments on commit 4e0f6f4

Please sign in to comment.