From 786bb337f0f74ccf0ff1197780e09288e42d667a Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Wed, 9 Feb 2022 16:38:30 -0700 Subject: [PATCH] cherry-pick(#11991): fix(mac): avoid printing empty line to stderr on mac (#11993) SHA: 1f6b84f445597655b015df52cef0784d9963492c It turns out, `sw_vers` prints an empty stderr line and we inherit it. Co-authored-by: Dmitry Gozman --- packages/playwright-core/src/utils/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/playwright-core/src/utils/utils.ts b/packages/playwright-core/src/utils/utils.ts index 683f39c156..7bc5c94c3f 100644 --- a/packages/playwright-core/src/utils/utils.ts +++ b/packages/playwright-core/src/utils/utils.ts @@ -457,7 +457,7 @@ function determineUserAgent(): string { osIdentifier = 'windows'; osVersion = `${version[0]}.${version[1]}`; } else if (process.platform === 'darwin') { - const version = execSync('sw_vers -productVersion').toString().trim().split('.'); + const version = execSync('sw_vers -productVersion', { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim().split('.'); osIdentifier = 'macOS'; osVersion = `${version[0]}.${version[1]}`; } else if (process.platform === 'linux') {