Skip to content

Commit

Permalink
fix(install): check macOS version to be 10.14 or higher (#671)
Browse files Browse the repository at this point in the history
Fixes #669
  • Loading branch information
pavelfeldman authored and aslushnikov committed Jan 27, 2020
1 parent e65cc77 commit 6e4bf95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/server/webkit.ts
Expand Up @@ -224,9 +224,11 @@ const mkdtempAsync = platform.promisify(fs.mkdtemp);
const WEBKIT_PROFILE_PATH = path.join(os.tmpdir(), 'playwright_dev_profile-');

let cachedMacVersion: string | undefined = undefined;
function getMacVersion() {

function getMacVersion(): string {
if (!cachedMacVersion) {
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;
}
return cachedMacVersion;
Expand Down

0 comments on commit 6e4bf95

Please sign in to comment.