Skip to content

Commit

Permalink
Move yauzl to dynamic import
Browse files Browse the repository at this point in the history
  • Loading branch information
kewisch committed Jun 12, 2024
1 parent 38eeea5 commit 11f7d2d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/scriptutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import { Octokit } from "@octokit/core";
import fetch from 'node-fetch';
import yauzl from 'yauzl-promise';
import fs from "fs/promises";
import fsc from "fs";
import path from "path";
Expand Down Expand Up @@ -64,6 +63,11 @@ async function get_latest_main(outFile) {
}

let buffer = Buffer.from(await response.arrayBuffer());

// Yauzl has been difficult due to the native bindings for crc32.
// Import ad-hoc to make GitHub Actions work.
let yauzl = await import("yauzl-promise");

let archive = await yauzl.fromBuffer(buffer);

let entry;
Expand Down Expand Up @@ -152,6 +156,7 @@ async function main() {
break;
case "replace-unpkg":
await replace_unpkg(process.argv[3], process.argv[4]);
case "test":

Check failure on line 159 in tools/scriptutils.js

View workflow job for this annotation

GitHub Actions / Build & Test (lts/*)

Expected a 'break' statement before 'case'

Check failure on line 159 in tools/scriptutils.js

View workflow job for this annotation

GitHub Actions / Build & Test (node)

Expected a 'break' statement before 'case'
}
}
main();

0 comments on commit 11f7d2d

Please sign in to comment.