fix: add best-effort support for MacOS beta versions (#7003)

Similarly to how we provide best-effort support for non-LTS ubuntu
versions, this patch adds support for beta versions of MacOS releases.
This commit is contained in:
Andrey Lushnikov 2021-06-09 14:58:20 -07:00 committed by GitHub
parent 178489d091
commit 3c7d2aae6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,9 +186,16 @@ export const hostPlatform = ((): BrowserPlatform => {
stdio: ['ignore', 'pipe', 'ignore']
}).toString().trim() === '1';
}
// We do not want to differentiate between minor big sur releases
// since they don't change core APIs so far.
const macVersion = major === 10 ? `${major}.${minor}` : `${major}`;
const LAST_STABLE_MAC_MAJOR_VERSION = 11;
// All new MacOS releases increase major version.
let macVersion = `${major}`;
if (major === 10) {
// Pre-BigSur MacOS was increasing minor version every release.
macVersion = `${major}.${minor}`;
} else if (major > LAST_STABLE_MAC_MAJOR_VERSION) {
// Best-effort support for MacOS beta versions.
macVersion = LAST_STABLE_MAC_MAJOR_VERSION + '';
}
const archSuffix = arm64 ? '-arm64' : '';
return `mac${macVersion}${archSuffix}` as BrowserPlatform;
}