fix(install): check macOS version to be 10.14 or higher (#671)
Fixes #669
This commit is contained in:
parent
e65cc77f31
commit
6e4bf9561b
|
|
@ -224,9 +224,11 @@ const mkdtempAsync = platform.promisify(fs.mkdtemp);
|
||||||
const WEBKIT_PROFILE_PATH = path.join(os.tmpdir(), 'playwright_dev_profile-');
|
const WEBKIT_PROFILE_PATH = path.join(os.tmpdir(), 'playwright_dev_profile-');
|
||||||
|
|
||||||
let cachedMacVersion: string | undefined = undefined;
|
let cachedMacVersion: string | undefined = undefined;
|
||||||
function getMacVersion() {
|
|
||||||
|
function getMacVersion(): string {
|
||||||
if (!cachedMacVersion) {
|
if (!cachedMacVersion) {
|
||||||
const [major, minor] = execSync('sw_vers -productVersion').toString('utf8').trim().split('.');
|
const [major, minor] = execSync('sw_vers -productVersion').toString('utf8').trim().split('.');
|
||||||
|
assert(+major === 10 && +minor >= 14, 'Error: unsupported macOS version, macOS 10.14 and newer are supported');
|
||||||
cachedMacVersion = major + '.' + minor;
|
cachedMacVersion = major + '.' + minor;
|
||||||
}
|
}
|
||||||
return cachedMacVersion;
|
return cachedMacVersion;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue