cherry-pick(#11991): fix(mac): avoid printing empty line to stderr on mac (#11993)

SHA: 1f6b84f445

It turns out, `sw_vers` prints an empty stderr line and we inherit it.

Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
This commit is contained in:
Andrey Lushnikov 2022-02-09 16:38:30 -07:00 committed by GitHub
parent 8f1f97f508
commit 786bb337f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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') {