|
1 | 1 | diff --git a/lib/cjs/CLI.js b/lib/cjs/CLI.js |
2 | | -index a4746096241ebaaf7b3eca40a6d8b0fd13191118..d99e48860395f27d751ae63828f91fba7c3738f9 100644 |
| 2 | +index a4746096241ebaaf7b3eca40a6d8b0fd13191118..77e6517fe29ea97112d36b6464139f95fc4e40d9 100644 |
3 | 3 | --- a/lib/cjs/CLI.js |
4 | 4 | +++ b/lib/cjs/CLI.js |
5 | | -@@ -177,6 +177,8 @@ class CLI { |
6 | | - default: false, |
7 | | - }); |
8 | | - }, async (args) => { |
9 | | -+ console.log('args.browser', args.browser); |
10 | | -+ console.log('pinnedBrowsers', this.#pinnedBrowsers); |
11 | | - if (this.#pinnedBrowsers && !args.browser) { |
12 | | - // Use allSettled to avoid scenarios that |
13 | | - // a browser may fail early and leave the other |
14 | | -@@ -195,6 +197,7 @@ class CLI { |
15 | | - })); |
16 | | - for (const install of result) { |
17 | | - if (install.status === 'rejected') { |
18 | | -+ console.log(install.reason); |
19 | | - throw install.reason; |
20 | | - } |
21 | | - } |
22 | | -@@ -303,6 +306,7 @@ class CLI { |
23 | | - : 'latest'; |
24 | | - } |
25 | | - async #install(args) { |
26 | | -+ console.log('start install', args); |
27 | | - args.platform ??= (0, detectPlatform_js_1.detectBrowserPlatform)(); |
28 | | - if (!args.browser) { |
29 | | - throw new Error(`No browser arg provided`); |
30 | | -@@ -318,7 +322,18 @@ class CLI { |
31 | | - args.browser.buildId = options.buildId; |
| 5 | +@@ -319,6 +319,7 @@ class CLI { |
32 | 6 | } |
33 | 7 | const originalBuildId = args.browser.buildId; |
34 | | -+ console.log('before resolveBuildId', args.browser); |
35 | 8 | args.browser.buildId = await (0, browser_data_js_1.resolveBuildId)(args.browser.name, args.platform, args.browser.buildId); |
36 | | -+ console.log('after resolveBuildId', args.browser, { |
37 | | -+ browser: args.browser.name, |
38 | | -+ buildId: args.browser.buildId, |
39 | | -+ platform: args.platform, |
40 | | -+ cacheDir: args.path ?? this.#cachePath, |
41 | | -+ downloadProgressCallback: 'default', |
42 | | -+ baseUrl: args.baseUrl, |
43 | | -+ buildIdAlias: originalBuildId !== args.browser.buildId ? originalBuildId : undefined, |
44 | | -+ installDeps: args.installDeps, |
45 | | -+ }); |
| 9 | ++ console.log('after resolveBuildId', args.browser); |
46 | 10 | await (0, install_js_1.install)({ |
47 | 11 | browser: args.browser.name, |
48 | 12 | buildId: args.browser.buildId, |
| 13 | +diff --git a/lib/cjs/install.js b/lib/cjs/install.js |
| 14 | +index 35c7229df92528c119d5836d9c863a7de01f0977..4dd7270586f9fed89f740d0e97802d0b7e75dbf1 100644 |
| 15 | +--- a/lib/cjs/install.js |
| 16 | ++++ b/lib/cjs/install.js |
| 17 | +@@ -48,10 +48,12 @@ async function install(options) { |
| 18 | + throw new Error(`Cannot download a binary for the provided platform: ${node_os_1.default.platform()} (${node_os_1.default.arch()})`); |
| 19 | + } |
| 20 | + const url = getDownloadUrl(options.browser, options.platform, options.buildId, options.baseUrl); |
| 21 | ++ console.log('install url', options, url); |
| 22 | + try { |
| 23 | + return await installUrl(url, options); |
| 24 | + } |
| 25 | + catch (err) { |
| 26 | ++ console.log('install catch', options, err); |
| 27 | + // If custom baseUrl is provided, do not fall back to CfT dashboard. |
| 28 | + if (options.baseUrl && !options.forceFallbackForTesting) { |
| 29 | + throw err; |
| 30 | +@@ -84,6 +86,7 @@ async function install(options) { |
| 31 | + const backupUrl = version.downloads[options.browser]?.find(link => { |
| 32 | + return link['platform'] === platform; |
| 33 | + })?.url; |
| 34 | ++ console.log('install backupUrl', options, backupUrl); |
| 35 | + if (backupUrl) { |
| 36 | + // If the URL is the same, skip the retry. |
| 37 | + if (backupUrl === url.toString()) { |
0 commit comments