chore: make installing non-hermetic browsers idempotent (#35791)

This commit is contained in:
Simon Knott 2025-04-29 12:16:53 +02:00 committed by GitHub
parent 9b6fbcc452
commit 1924b51d3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1053,7 +1053,7 @@ export class Registry {
const { embedderName } = getEmbedderName();
if (!getAsBooleanFromENV('CI') && !executable._isHermeticInstallation && !forceReinstall && executable.executablePath(embedderName)) {
const command = buildPlaywrightCLICommand(embedderName, 'install --force ' + executable.name);
throw new Error('\n' + wrapInASCIIBox([
process.stderr.write('\n' + wrapInASCIIBox([
`ATTENTION: "${executable.name}" is already installed on the system!`,
``,
`"${executable.name}" installation is not hermetic; installing newer version`,
@ -1067,7 +1067,8 @@ export class Registry {
` ${command}`,
``,
`<3 Playwright Team`,
].join('\n'), 1));
].join('\n'), 1) + '\n\n');
return;
}
await executable._install();
}