Skip to content

Commit

Permalink
fix(validate/webidl): set puppeteer exec path for reffy (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidvishnoi authored Apr 12, 2024
1 parent c6d5322 commit 071d7eb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/validate-webidl.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { rm } from "fs/promises";
import { env, exit, install, yesOrNo } from "./utils.js";
import { BuildResult } from "./build.js";
import { PUPPETEER_ENV } from "./constants.js";
type Input = Pick<BuildResult, "dest" | "file">;

if (module === require.main) {
Expand All @@ -14,6 +15,7 @@ if (module === require.main) {

export default async function main({ dest, file }: Input) {
console.log(`Validating Web IDL defined in ${file}...`);
Object.assign(process.env, PUPPETEER_ENV);
await install("reffy@15");
const { crawlSpecs } = require("reffy");

Expand All @@ -22,6 +24,7 @@ export default async function main({ dest, file }: Input) {
[{ url: fileurl, nightly: { url: fileurl } }],
{ modules: ["idl"] },
);
Object.keys(PUPPETEER_ENV).forEach(key => delete process.env[key]);
await rm(".cache", { recursive: true, force: true });

const idl = results[0]?.idl;
Expand Down

0 comments on commit 071d7eb

Please sign in to comment.