fix(msedge): install with multiple artifacts (#27939)

The API response looked like this:

<img width="1584" alt="image"
src="https://github.com/microsoft/playwright/assets/17984549/89d32ad4-8770-48c3-b562-231ae7b9ef3b">

-> multiple entries for `Windows` and `X64`, but some without artifacts.
-> We filter now for `artifacts.length > 0` which seems like a healthy
change.

Fixes https://github.com/microsoft/playwright/issues/22841
This commit is contained in:
Max Schmitt 2023-11-02 23:30:40 +01:00 committed by GitHub
parent a7fd515626
commit f9c4955fe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -918,7 +918,7 @@ export class Registry {
darwin: { platform: 'MacOS', arch: 'universal', artifact: 'pkg' },
win32: { platform: 'Windows', arch: 'x64', artifact: 'msi' },
} as any)[process.platform];
const release = searchConfig ? product.releases.find((release: any) => release.platform === searchConfig.platform && release.architecture === searchConfig.arch) : null;
const release = searchConfig ? product.releases.find((release: any) => release.platform === searchConfig.platform && release.architecture === searchConfig.arch && release.artifacts.length > 0) : null;
const artifact = release ? release.artifacts.find((artifact: any) => artifact.artifactname === searchConfig.artifact) : null;
if (artifact)
scriptArgs.push(artifact.location /* url */);