1- diff --git a/lib/cjs/CLI.js b/lib/cjs/CLI.js
2- index a4746096241ebaaf7b3eca40a6d8b0fd13191118..77e6517fe29ea97112d36b6464139f95fc4e40d9 100644
3- --- a/lib/cjs/CLI.js
4- +++ b/lib/cjs/CLI.js
5- @@ -319,6 +319,7 @@ class CLI {
6- }
7- const originalBuildId = args.browser.buildId;
8- args.browser.buildId = await (0, browser_data_js_1.resolveBuildId)(args.browser.name, args.platform, args.browser.buildId);
9- + console.log('after resolveBuildId', args.browser);
10- await (0, install_js_1.install)({
11- browser: args.browser.name,
12- buildId: args.browser.buildId,
131diff --git a/lib/cjs/install.js b/lib/cjs/install.js
14- index 35c7229df92528c119d5836d9c863a7de01f0977..81ebebf19eb5a4f956f67061281341b3d53ae9bd 100644
2+ index 35c7229df92528c119d5836d9c863a7de01f0977..f024f869e98845ff70199a1809e1cb8fafc8d3ac 100644
153--- a/lib/cjs/install.js
164+++ b/lib/cjs/install.js
17- @@ -84,6 +84,7 @@ async function install(options) {
18- const backupUrl = version.downloads[options.browser]?.find(link => {
19- return link['platform'] === platform;
20- })?.url;
21- + console.log('install backupUrl', options, backupUrl);
22- if (backupUrl) {
23- // If the URL is the same, skip the retry.
24- if (backupUrl === url.toString()) {
25- @@ -140,10 +141,12 @@ async function installUrl(url, options) {
5+ @@ -140,10 +140,12 @@ async function installUrl(url, options) {
266 downloadProgressCallback = await makeProgressCallback(options.browser, options.buildIdAlias ?? options.buildId);
277 }
288 const fileName = decodeURIComponent(url.toString()).split('/').pop();
@@ -35,31 +15,23 @@ index 35c7229df92528c119d5836d9c863a7de01f0977..81ebebf19eb5a4f956f67061281341b3
3515 if (!(0, node_fs_1.existsSync)(browserRoot)) {
3616 await (0, promises_1.mkdir)(browserRoot, { recursive: true });
3717 }
38- @@ -158,6 +161 ,7 @@ async function installUrl(url, options) {
18+ @@ -158,6 +160 ,7 @@ async function installUrl(url, options) {
3919 return archivePath;
4020 }
4121 const outputPath = cache.installationDir(options.browser, options.platform, options.buildId);
4222+ console.log('installUrl outputPath', options.browser, outputPath);
4323 try {
4424 if ((0, node_fs_1.existsSync)(outputPath)) {
4525 const installedBrowser = new Cache_js_1.InstalledBrowser(cache, options.browser, options.buildId, options.platform);
46- @@ -170,6 +174,7 @@ async function installUrl(url, options) {
47- }
48- return installedBrowser;
49- }
50- + console.log('installUrl Downloading binary', options.browser, url);
51- debugInstall(`Downloading binary from ${url}`);
52- try {
53- debugTime('download');
54- @@ -178,6 +183,7 @@ async function installUrl(url, options) {
26+ @@ -178,6 +181,7 @@ async function installUrl(url, options) {
5527 finally {
5628 debugTimeEnd('download');
5729 }
5830+ console.log('installUrl', options.browser, `Installing ${archivePath} to ${outputPath}`);
5931 debugInstall(`Installing ${archivePath} to ${outputPath}`);
6032 try {
6133 debugTime('extract');
62- @@ -186,12 +192 ,14 @@ async function installUrl(url, options) {
34+ @@ -186,12 +190 ,14 @@ async function installUrl(url, options) {
6335 finally {
6436 debugTimeEnd('extract');
6537 }
@@ -74,3 +46,19 @@ index 35c7229df92528c119d5836d9c863a7de01f0977..81ebebf19eb5a4f956f67061281341b3
7446 await runSetup(installedBrowser);
7547 if (options.installDeps) {
7648 await installDeps(installedBrowser);
49+ diff --git a/src/fileUtil.ts b/src/fileUtil.ts
50+ index e2876460c35cb01b54ab8ed4f10327da24e4766a..df2652e8f78ab18e41f6a13aec0b5400bbb132af 100644
51+ --- a/src/fileUtil.ts
52+ +++ b/src/fileUtil.ts
53+ @@ -27,8 +27,11 @@ export async function unpackArchive(
54+ folderPath = path.resolve(process.cwd(), folderPath);
55+ }
56+ if (archivePath.endsWith('.zip')) {
57+ + console.log('unpackArchive 1', archivePath);
58+ const extractZip = await import('extract-zip');
59+ + console.log('unpackArchive 2', archivePath, typeof extractZip);
60+ await extractZip.default(archivePath, {dir: folderPath});
61+ + console.log('unpackArchive 3', archivePath);
62+ } else if (archivePath.endsWith('.tar.bz2')) {
63+ await extractTar(archivePath, folderPath, 'bzip2');
64+ } else if (archivePath.endsWith('.dmg')) {
0 commit comments