From 2f0310f0748c332b0062d81377af2b2e79e456ac Mon Sep 17 00:00:00 2001 From: Michael Gissing Date: Wed, 7 Aug 2024 15:24:56 +0200 Subject: [PATCH] fix: ubuntu version detection for linux mint 22 --- packages/playwright-core/src/utils/hostPlatform.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/playwright-core/src/utils/hostPlatform.ts b/packages/playwright-core/src/utils/hostPlatform.ts index 9e7be7a5a8..faf65bd082 100644 --- a/packages/playwright-core/src/utils/hostPlatform.ts +++ b/packages/playwright-core/src/utils/hostPlatform.ts @@ -78,9 +78,12 @@ function calculatePlatform(): { hostPlatform: HostPlatform, isOfficiallySupporte } // Linux Mint is ubuntu-based but does not have the same versions if (distroInfo?.id === 'linuxmint') { - if (parseInt(distroInfo.version, 10) <= 20) + const mintMajor = parseInt(distroInfo.version, 10); + if (mintMajor <= 20) return { hostPlatform: ('ubuntu20.04' + archSuffix) as HostPlatform, isOfficiallySupportedPlatform: false }; - return { hostPlatform: ('ubuntu22.04' + archSuffix) as HostPlatform, isOfficiallySupportedPlatform: false }; + if (mintMajor === 21) + return { hostPlatform: ('ubuntu22.04' + archSuffix) as HostPlatform, isOfficiallySupportedPlatform: false }; + return { hostPlatform: ('ubuntu24.04' + archSuffix) as HostPlatform, isOfficiallySupportedPlatform: false }; } if (distroInfo?.id === 'debian' || distroInfo?.id === 'raspbian') { const isOfficiallySupportedPlatform = distroInfo?.id === 'debian';